Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A lighter "File not Found" routine
#2
My method is to use ON ERROR with OPEN...FOR INPUT -
[syntax="QBasic"]ON ERROR GOTO fileNotFound
OPEN "folder\fileName.ext" FOR INPUT AS #1: CLOSE #1
'{program goes here}
END 'END must be here unless you want to run your error handling section, even if there are no errors

fileNotFound:
IF ERR = 53 THEN PRINT "File Not Found. Ending program.": END[/syntax]

I hope that helps!
974277320612072617420666C61696C21 (Hexadecimal for those who don't know)
Reply


Messages In This Thread
A lighter "File not Found" routine - by Rokkuman - 08-22-2005, 01:55 AM
A lighter "File not Found" routine - by rpgfan3233 - 08-22-2005, 02:20 AM
Re: A lighter "File not Found" routine - by Moneo - 08-22-2005, 07:04 AM
A lighter "File not Found" routine - by Neo - 08-22-2005, 04:04 PM
A lighter "File not Found" routine - by mjs - 08-23-2005, 02:07 AM
A lighter "File not Found" routine - by Moneo - 08-23-2005, 05:11 AM
A lighter "File not Found" routine - by Z!re - 08-23-2005, 05:32 AM
A lighter "File not Found" routine - by Agamemnus - 08-23-2005, 09:45 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)