13–18 Programming Techniques
File name 33s-E-Manual-1008-Publication(1st).doc Page : 386
Printed Date : 2003/10/8 Size : 13.7 x 21.2 cm
Program lines:
(In RPN mode)
Description:
Checksum and length: D548 9
It is easier to recall A than to remember where it is in the
stack.
Calculates A – B.
Replaces old A with new result.
Recalls constant for comparison.
Is B
<
new A
?
Yes: loops to repeat subtraction.
No: displays new A.
Checksum and length: AC36 27
Loops With Counters (DSE, ISG)
When you want to execute a loop a specific number of times, use the
¹
ª
(increment; skip if greater than) or
º
«
(decrement; skip if less than or equal
to) conditional function keys. Each time a loop function is executed in a program, it
automatically decrements or increments a counter value stored in a variable. It
compares the current counter value to a final counter value, then continues or exits
the loop depending on the result.
For a count–down loop, use
º
«
variable
For a count–up loop, use
¹
ª
variable
These functions accomplish the same thing as a FOR–NEXT loop in BASIC:
variable = initial–value
final–value
increment
.
.
.
variable