13-11
Testing a Program
If you know there is an error in a program, but are not sure where the error is, then
a good way to test the program is by stepwise execution. It is also a good idea to
test a long or complicated program before relying on it. By stepping through its
execution, one line at a time, you can see the result after each program line is
executed, so you can verify the progress of known data whose correct results are
also known.
1.
As for regular execution, make sure program entry is not active (
PRGM
annunciator off).
2
.
Set the program pointer to the start of the program (that is, at its LBL
instruction). The instruction moves the program pointer without starting
execution.
3.
Press and hold
Ø
. This displays the current program line. When you release
Ø
, the line is executed. The result of that execution is then displayed (it is in
the X–register).
To move to the
preceding
line, you can press
×
. No execution occurs.
4.
The program pointer moves to the next line. Repeat step 3 until you find an
error (an incorrect result occurs) or reach the end of the program.
If Program–entry mode is active, then
Ø
or
×
simply changes the program
pointer, without executing lines. Holding down a cursor key during program entry
makes the lines roll by automatically.
Example:
Testing a Program.
Step through the execution of the program labeled A. Use a radius of 5 for the test
data. Check that Program–entry mode is
not
active before you start:
Keys:
(In RPN mode)
Display:
Description:
Moves program counter to label A.
Ø
(hold) (release)
Ø
(hold) (release)
Squares input.
Содержание 35s
Страница 1: ...HP 35s scientific calculator user s guide H Edition 1 HP part number F2215AA 90001 ...
Страница 14: ...12 Contents ...
Страница 15: ...Part 1 Basic Operation ...
Страница 16: ......
Страница 46: ...1 30 Getting Started ...
Страница 63: ...RPN The Automatic Memory Stack 2 17 A Solution ...
Страница 64: ...2 18 RPN The Automatic Memory Stack ...
Страница 74: ...3 10 Storing Data into Variables ...
Страница 180: ...12 14 Statistical Operations ...
Страница 181: ...Part 2 Programming ...
Страница 182: ......
Страница 246: ...15 12 Solving and Integrating Programs ...
Страница 270: ...16 24 Statistics Programs ...
Страница 284: ...17 14 Miscellaneous Programs and Equations ...
Страница 285: ...Part 3 Appendixes and Reference ...
Страница 286: ......
Страница 308: ...B 8 User Memory and the Stack ...
Страница 322: ...C 14 ALG Summary ...
Страница 336: ...D 14 More about Solving ...
Страница 346: ...E 10 More about Integration ...
Страница 352: ...F 6 Messages ...
Страница 370: ...G 18 Operation Index ...
Страница 382: ...Index 12 ...