Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / How does one check for a file?

Author
Message
Rwilson
21
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 25th Sep 2003 02:07
I've tried using File Exist like so:
file = File exist "Save File.sav"
if file = 1 then delete file "Save File.sav"

However, the blasted thing keeps telling me that it can't determine the data type of parameters, or something along those lines. Am I using the wrong command, or am I just using it command wrong?
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 25th Sep 2003 02:41
If what you have written here, is the same as in your code I think it should read like this.

file = File Exist("nameofyourfile")

if file = 1 then delete file "nameofyourfile"

see if that makes it work.

ps. the bottom part of the editor next to INS box shows how a commad should be entered. Like which part is X and which part is Y.
Rwilson
21
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 25th Sep 2003 02:45
Gah! It was the () I missed! Silly Me. Thanks HowDo!
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 25th Sep 2003 02:55
Yep but don't forget the full file path name.

try also

if File = 1 then print "its there"
if File = 0 then print "no go "

It'll help in writing the correct path name.

Login to post a reply

Server time is: 2024-11-25 08:47:03
Your offset time is: 2024-11-25 08:47:03