Debugging and Error Control

The following functions can be used to trap and manage error conditions:

#DEBUG CODE | Compiler directive to suppress generation of debugging code.
#DEBUG DISPLAY | Display a message when an untrapped run-time error occurs.
#DEBUG ERROR | Control generation of error checking code.
#DEBUG PRINT | Display information in the IDE's Debug Window.
#DIM | Specify if variables must be declared before use.
#STACK | Set the maximum potential stack size.
#TOOLS | Enable/disable integrated development tools in compiled code.
CALLSTK | Capture a representation of the stack frames in the call stack.
CALLSTK$ | Retrieve the details of a specific stack frame.
CALLSTKCOUNT | Retrieve the number of stack frames in the call stack.
ERL | Return the line number of the most recent run-time error.
ERL$ | Return the last label, line number, or procedure name executed prior to the most recent error.
ERR | Return the error code of the most recent run-time error.
ERRCLEAR | Return and clear the error code of the most recent run-time error.
ERROR | Cause a specific run-time error to be generated and set ERR.
ERROR$ | Return a string containing the descriptive name of an error.
FILENAME$ | Return the file-system name of an open file.
FUNCNAME$ | Return the name of the current Sub/Function/Method/Property.
ON ERROR | Specify an error handling routine; enable/disable trapping.
OPTION EXPLICIT | Force explicit declaration of all variables.
PROFILE | Capture an execution time profile of the Subs, Functions, Methods, and Properties.
RESUME | Continue execution after error handling with ON ERROR GOTO.
RESUME FLUSH | Execution continues on the line immediately following the RESUME FLUSH.
RESUME NEXT | Execution continues on the line immediately following the one which generated the error.
RESUME <Label> | Execution continues at the specified label location.
TRACE | Capture the precise flow of execution in a module.
TRY/END TRY | A structured method of trapping and responding to errors.