Poll: is this question stupid? (hint: click yes!)
You do not have permission to vote in this poll.
yes
100.00%
11 100.00%
Total 11 vote(s) 100%
* You voted for this item. [Show Results]

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error meesages
#8
You mean, if the file which the user entered is not found, the file should be created?, if so:
Code:
ON ERROR GOTO ErrorHandler

INPUT "File:"; File$

OPEN File$ FOR INPUT AS #1
CLOSE #1

ErrorHandler:
SELECT CASE ERR
CASE 53
PRINT "File not found."
PRINT "Creating file:"; File$
OPEN File$ FOR OUTPUT AS #1
CLOSE #1
RESUME
CASE 64
PRINT "The file name you entered was incorrect."
CASE 76
PRINT "Path not found."
END SELECT
' untested
Ok, this is what it does:
If the file was not found, it prints out "File not found.", "Creating file: Somefile"
Then it creates the file, and tries to reopen the file again, using RESUME.
RESUME resumes the code line where the error occured.
Reply


Messages In This Thread
Error meesages - by somekid - 10-23-2002, 06:25 PM
Error meesages - by red_Marvin - 10-23-2002, 06:59 PM
Error meesages - by somekid - 10-24-2002, 05:42 PM
Error meesages - by BlueKeyboard - 10-24-2002, 06:01 PM
Error meesages - by Neo - 10-28-2002, 04:00 PM
if statements for error trapping - by somekid - 10-30-2002, 07:16 PM
Error meesages - by BlueKeyboard - 10-30-2002, 07:23 PM
Error meesages - by somekid - 10-30-2002, 07:43 PM
Error meesages - by BlueKeyboard - 10-30-2002, 10:27 PM
Error meesages - by Neo - 10-31-2002, 03:52 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)