Purpose |
Control generation of error checking code |
Syntax |
#DEBUG ERROR {ON|+ | OFF|-} |
Remarks |
#DEBUG ERROR option specifies whether the compiler should generate code that checks for array boundary and null-pointer errors wherever they may occur. The default setting is OFF. When #DEBUG ERROR mode is ON, any attempt to access an array outside of its boundaries, or attempting to use a null-pointer will generate a run-time Error 9 ("Subscript/Pointer out of range"), and the statement itself is not executed. When OFF, all statements are executed "as-is" and no errors are generated. However, accessing an array outside its boundaries or using a null-pointer can cause a General Protection Fault (GPF) or Exception error. It is best to enable #DEBUG ERROR error checking when developing a program. Once all of the more obvious bugs have been eradicated, you will want to return to the default setting (OFF), as this will make your code smaller and faster. Depending on the type of application being developed, the final (production) version of a program may not need to contain any error-checking code. |
Restrictions |
#DEBUG ERROR is always enabled when code is running within the Debugger, regardless of any explicit #DEBUG ERROR metastatement. Disk I/O errors are always caught, regardless of the state of #DEBUG ERROR. #DEBUG ERROR ON does not trap array boundary errors of arrays within User-Defined Types and Unions. Pointers are only tested for null (zero) values. Non-zero pointer target addresses are not tested for readability or writeability. |
See also |