FutureBasic Logo

<<    Index    >> FutureBasic

on error end   statement

on error end Description
There are two possible outcomes when using this statement and they depend on other factors in your program. If you have not established any other error handling routine, then you may use this routine to turn off all error checking. Errors such as file errors will be ignored. It will be your responsibility to track them manually after each file access statement by checking the function error. This concept is demonstrated in the example below.
A second use involves programs where you have set up your own error handling routines. You may toggle between FutureBasic's error handling and your program's built-in error handlers by using on error end to turn off FutureBasic's handlers and use the ones in your program. Alternatively, you may use on error return to reinstate FutureBasic's handlers.

// Manual, line-by-line error handling
print "This program will produce a file error"
print "that is completely ignored."
on error end
open "I",#1,"this file does not exist"
print "The error has occurred and was not flagged."
print "The error number is"; error and &FF
print "In file number"; error >> 8

If you turn off error checking (on error end) and you get an error with x = error, then your program must clear the error variable with error = _noErr

See also
on error fn; on error return; error