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.
Summary of Contents for 35s
Page 1: ...HP 35s scientific calculator user s guide H Edition 1 HP part number F2215AA 90001 ...
Page 14: ...12 Contents ...
Page 15: ...Part 1 Basic Operation ...
Page 16: ......
Page 46: ...1 30 Getting Started ...
Page 63: ...RPN The Automatic Memory Stack 2 17 A Solution ...
Page 64: ...2 18 RPN The Automatic Memory Stack ...
Page 74: ...3 10 Storing Data into Variables ...
Page 180: ...12 14 Statistical Operations ...
Page 181: ...Part 2 Programming ...
Page 182: ......
Page 246: ...15 12 Solving and Integrating Programs ...
Page 270: ...16 24 Statistics Programs ...
Page 284: ...17 14 Miscellaneous Programs and Equations ...
Page 285: ...Part 3 Appendixes and Reference ...
Page 286: ......
Page 308: ...B 8 User Memory and the Stack ...
Page 322: ...C 14 ALG Summary ...
Page 336: ...D 14 More about Solving ...
Page 346: ...E 10 More about Integration ...
Page 352: ...F 6 Messages ...
Page 370: ...G 18 Operation Index ...
Page 382: ...Index 12 ...