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

Other Programming Functions

Page 91 highlights

Other Programming Functions (HOLD) thus one second. DISP: takes a number that represents 1/5 of a second. DISP5 is (HOLD) STOP: Stops the execution of the program. This instruction should be placed at the end of every program. (HOLD) R/S: Pauses the program execution and returns to the normal system. You can then resume program execution by pressing for example, when you need to enter a number. again. This can be used, (HOLD) DSE ( ) and (HOLD) ISG ( ), followed by 1 digit (0 to 9): Loop control function. Place a number of the form ccccc.eeeii where cccc is the counter, eee is the end value for the counter and ii is the increment in variable 1. For example, DSE 1 will decrement the counter part of the variable by ii (if ii is 0, it decrements by 1) and, if cccc is less or equal to eee, it will skip the next instruction (usually a GOTO). For example, to loop from 0 to 50, incrementing by 3 each loop, use 0.05003 as start the value and the ISG instruction. The following program will loop from 0-50, incrementing by 3 each loop and pause shortly at each loop to show the counter. At the end, it will leave 12 with a blinking cursor. Once in Program mode, select an unused program number and press: .05003:$1 (HOLD) (HOLD) (HOLD) (HOLD) This program has 22 bytes, and the Checksum is 146. (HOLD) Programming 83

  • 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
83
Other Programming Functions
(HOLD)
DISP:
takes a number that represents 1/5 of a second. DISP5 is
thus one second.
(HOLD)
STOP:
Stops the execution of the program. This instruction should be
placed at the end of every program.
(HOLD)
R/S:
Pauses the program execution and returns to the normal system.
You can then resume program execution by pressing
again. This can be used,
for example, when you need to enter a number.
(HOLD)
DSE
(
) and
(HOLD)
ISG
(
), followed by 1 digit (0
to 9): Loop control function. Place a number of the form ccccc.eeeii where
cccc
is the counter,
eee
is the end value for the counter and
ii
is the increment in variable 1. For example, DSE 1
will decrement the counter part of the variable by ii (if ii is 0, it decrements by 1) and, if
cccc
is less or equal to
eee
, it will skip the next instruction (usually a GOTO).
For example, to loop from 0 to 50, incrementing by 3 each loop, use 0.05003 as start the
value and the ISG instruction. The following program will loop from 0-50, incrementing by 3
each loop and pause shortly at each loop to show the counter. At the end, it will leave 12
with a blinking cursor. Once in Program mode, select an unused program number and press:
.05003:$1
(HOLD)
(HOLD)
(HOLD)
(HOLD)
(HOLD)
This program has 22 bytes, and the Checksum is 146.