Programming
620
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 confirm that a loop is executed the correct number of times, display the counter
variable or the values in the conditional test.
•
To confirm that a subroutine is executed, display messages such as
Entering
subroutine
and
Exiting subroutine
at the beginning and end of the subroutine.
Error-Handling Commands
Command
Description
Try...EndTry
Defines a program block that lets the program execute a
command and, if necessary, recover from an error
generated by that command.
ClrErr
Clears the error status and sets the error number in system
variable Errornum to zero.
PassErr
Passes an error to the next level of the
Try...EndTry
block.
Содержание Titanium TI-89
Страница 9: ...Getting Started 6 TI 89 Titanium keys Ë Ì Í Ê ...
Страница 34: ...Getting Started 31 2 or D 2 B u s i n e s s D B D B Press Result ...
Страница 43: ...Getting Started 40 3 0 D B D D B D Press Result ...
Страница 44: ...Getting Started 41 D 2 0 0 2 D B Scroll down to October and press Press Result ...
Страница 58: ...Getting Started 55 Example Set split screen mode to TOP BOTTOM Press Result 3 B D ...
Страница 70: ...Getting Started 67 ...
Страница 175: ...Operating the Calculator 172 From the Keyboard ...
Страница 456: ...Tables 453 ...
Страница 503: ...Split Screens 500 Note Both Top Bottom and Left Right splits use the same methods to select an application ...
Страница 527: ...Data Matrix Editor 524 ...
Страница 704: ...Connectivity 701 A TI 89 Titanium and a Voyage 200 linked together I O Port I O Port I O unit to unit cable ...