![]() Previous |
![]() Next |
To make sure the program works correctly, anticipate errors and set up a system for handling them. You can use a TRAP statement to turn on an error-trapping mechanism in a program. When error trapping is on and an error is signaled, then the execution of the program is not halted. Instead, error trapping does the following:
Turns off the error-trapping mechanism to prevent endless looping in case additional errors occur during the error-handling process
Branches to the label that is specified in the TRAP
statement
Executes the statements following the label