If your function or program allows the user to select from several
options, be sure to run it and test each option.
Techniques for debugging
Run-time error messages can locate syntax errors but not errors in
program logic. The following techniques may be useful.
•
Temporarily insert
variables.
•
To confirm that a loop is executed the correct number of times, use
to display the counter variable or the values in the conditional
Disp
test.
•
To confirm that a subroutine is executed, use
messages such as "Entering subroutine" and "Exiting subroutine" at
the beginning and end of the subroutine.
Error-handling commands
Command
Try...EndTry
ClrErr
PassErr
342
commands to display the values of critical
Disp
Description
Defines a block that lets a function or program execute
a command and, if necessary, recover from an error
generated by that command.
Clears the error status and sets the error number in
system variable Errornum to zero.
Passes an error to the next level of the
block.
to display
Disp
Try...EndTry
Programming