forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


verify file existance, execute if exist, else messagebox!

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
noveltech
Contributor
Contributor


Joined: 16 Sep 2002
Posts: 105

PostPosted: Mon Sep 16, 2002 9:30 pm    Post subject: verify file existance, execute if exist, else messagebox! Reply with quote

Could someone provide an example for
verifying file existance, execute if exist, else messagebox and then return to program.

Thank you. Jen.
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Mon Sep 16, 2002 9:36 pm    Post subject: Reply with quote

Code:

if @file("c:\windows\notepad.exe")
   RUN "c:\windows\notepad.exe"
else
   WARN Cannot find "c:\windows\notepad.exe"...
end

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
LOBO
Valued Contributor
Valued Contributor


Joined: 14 Mar 2002
Posts: 241
Location: Wilmington, Delaware, USA

PostPosted: Mon Sep 16, 2002 9:40 pm    Post subject: Reply with quote

Just a quick little code snippet example using shell open or you can use run.

Code:

%%file = "c:\textfile.txt"
if @file(%%file)
shell open %%file
else
warn %%file does not exist
end


Regards,
Mark

Edit: Looks like Mac beat me to it Laughing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Mon Sep 16, 2002 9:51 pm    Post subject: Reply with quote

That's just good teamwork LOBO. I gave a RUN
example and you gave one for SHELL... Wink

One more note....

Check the help file under RUN and SHELL, there
are some variations of RUN (RUNH, RUNM, RUNZ)
and some optional parameters for SHELL.

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group