HP 30b HP 20b Business Consultant and HP 30b Business Professional User's Guid - Page 93

Debugging a Program, instruction, press

Page 93 highlights

> I . 3. Press until the letter R appears, and then press . Press and the screen should display a ?. O 4. Press to exit. : 5. Press (HOLD) O . Then press to exit. :E 6. Now enter program mode again by pressing . The display will show R? in video inverse. Since program 0 has a message as the first command, it is now named k R?. The video inverse signifies that it is assigned to a key, in this case . Press Oto exit. :k 7. Now press . Notice R? appears, and the program pauses to wait for input. 5= : Type and press (HOLD) calculates the volume. to resume. The program continues and Debugging a Program At times, programs do not work as expected. You can debug your programs by pressing the : > : < (HOLD) or (HOLD) keys as follows: Open the Program menu and select the program you want to debug. To execute the first : < instruction, press (HOLD) . Press this key combination repeatedly to execute your < program one instruction at a time. The current instruction is displayed as long as the key is pressed. : > If you want to see the next instruction without executing it, press (HOLD) in the same manner. : If you want to let the program continue by itself, press (HOLD) . If you want to start debugging a program in the middle, place a run/stop (R/S) instruction where you want : to start debugging the program, run the program and start debugging using (HOLD) > < or when the program stops due to the R/S. Programming 85

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114

Programming
85
3.
Press
>
until the letter
R
appears, and then press
I
. Press
.
and the
screen should display a
?
.
4.
Press
O
to exit.
5.
Press
:
(HOLD)
. Then press
O
to exit.
6.
Now enter program mode again by pressing
:E
. The display will show
R?
in
video inverse. Since program 0 has a message as the first command, it is now named
R?
. The video inverse signifies that it is assigned to a key, in this case
k
. Press
O
to exit.
7.
Now press
:k
. Notice
R?
appears, and the program pauses to wait for input.
Type
5=
and press
:
(HOLD)
to resume. The program continues and
calculates the volume.
Debugging a Program
At times, programs do not work as expected. You can debug your programs by pressing the
:
(HOLD)
>
or
:
(HOLD)
<
keys as follows:
Open the Program menu and select the program you want to debug. To execute the first
instruction, press
:
(HOLD)
<
. Press this key combination repeatedly to execute your
program one instruction at a time. The current instruction is displayed as long as the
<
key is pressed.
If you want to see the next instruction without executing it, press
:
(HOLD)
>
in the
same manner.
If you want to let the program continue by itself, press
:
(HOLD)
. If you want to
start debugging a program in the middle, place a run/stop (R/S) instruction where you want
to start debugging the program, run the program and start debugging using
:
(HOLD)
>
or
<
when the program stops due to the R/S.