Futurebasic/Language/Reference/on error fn

Revised
June, 2001 (Release 5)

Description
This statement designates and enables the routine that FB will call when certain kinds of errors occur. There may only be one  vector. If you use a second call to, the new routine replaces the old version in subsequent calls. However you can deactivate or reactivate error trapping as often as you need. Using the /  statements you can switch between the default behavior and your error handler.

Example:

Note:

If you use the  syntax, then   must refer to a function which was defined or prototyped at an earlier location in the source code. Your error handling function should not take any parameters, nor return a result.