Programming 635
Run-Time Errors
Run-Time ErrorsRun-Time Errors
Run-Time Errors
The first step in debugging your program is to run it. The graphing calculator
automatically checks each executed command for syntax errors. If there is an error, a
message indicates the nature of the error.
• To cancel program execution and return to the Home screen, press N.
If your program allows the user to select from several options, be sure to run the
program and test each option.
Debugging Techniques
Debugging TechniquesDebugging Techniques
Debugging Techniques
Run-time error messages can locate syntax errors but not errors in program logic. The
following techniques may be useful.
• During testing, do not use local variables so that you can check the variable values
after the program stops. When the program is debugged, declare the applicable
variables as local.
• Within a program, temporarily insert
Disp and Pause commands to display the
values of critical variables.
-
Disp and Pause cannot be used in a user-defined function. To temporarily
change the function into a program, change
Func and EndFunc to Prgm and
EndPrgm. Use Disp and Pause to debug the program. Then remove Disp and
Pause and change the program back into a function.
• To display the program in the Program
Editor, press ¸. The cursor appears
in the approximate area of the error.