![Texas Instruments TI-Nspire Скачать руководство пользователя страница 713](http://html.mh-extra.com/html/texas-instruments/ti-nspire/ti-nspire_manual-book_1094491713.webp)
Programming
701
Debugging programs and handling errors
After you write a function or program, you can use several techniques to
find and correct errors. You can also build an error-handling command
into the function or program itself.
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
Disp
commands to display the values of critical
variables.
•
To confirm that a loop is executed the correct number of times, use
Disp
to display the counter variable or the values in the conditional
test.
•
To confirm that a subroutine is executed, use
Disp
to display
messages such as “Entering subroutine” and “Exiting subroutine” at
the beginning and end of the subroutine.
•
To stop a program or function manually,
–
Windows®:
Hold down the
F12
key and press
Enter
repeatedly.
–
Macintosh®:
Hold down the
F5
key and press
Enter
repeatedly.
–
Handheld:
Hold down the
c
key and press
·
repeatedly.
Error-handling commands
Command
Description
Try...EndTry
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 system variable to zero.
For an example of using , see the command in the
Reference Guide
.
PassErr
Passes an error to the next level of the
Try...EndTry
block.
Содержание TI-Nspire
Страница 38: ...26 Setting up the TI Nspire Navigator Teacher Software ...
Страница 46: ...34 Getting started with the TI Nspire Navigator Teacher Software ...
Страница 84: ...72 Using the Content Workspace ...
Страница 180: ...168 Capturing Screens ...
Страница 256: ...244 Embedding documents in web pages ...
Страница 332: ...320 Polling students For detailed information on viewing and sorting poll results see Using the Review Workspace ...
Страница 336: ...324 Polling students ...
Страница 374: ...362 Using the Review Workspace ...
Страница 436: ...424 Calculator ...
Страница 450: ...438 Using Variables ...
Страница 602: ...590 Using Lists Spreadsheet ...
Страница 676: ...664 Using Notes You can also change the sample size and restart the sampling ...
Страница 684: ...672 Libraries ...
Страница 714: ...702 Programming ...
Страница 828: ...816 Data Collection and Analysis ...
Страница 846: ...834 Regulatory Information ...
Страница 848: ...836 ...