HP 35s Scientific Calculator User Manual

Page 229

Advertising
background image

Programming Techniques

14-19

ii is the interval for incrementing and decrementing (must be two digits or
unspecified). This value does not change. An unspecified value for ii is
assumed to be 01 (increment/decrement by 1).

Given the loop–control number ccccccc.fffii, DSE decrements ccccccc to ccccccc —
ii
, compares the new ccccccc with fff, and makes program execution skip the next
program line if this ccccccc

fff.

Given the loop–control number ccccccc.fffii, ISG increments ccccccc to ccccccc + ii,
compares the new ccccccc with fff, and makes program execution skip the next
program line if this ccccccc

>

fff.

For example, the loop–control number 0.050 for ISG means: start counting at zero,
count up to 50, and increase the number by 1 each loop.

If the loop-control number is a complex number or vector, it will use the real part or
first part to control the loop.

The following program uses ISG to loop 10 times in RPN mode. The loop counter
(1.010) is stored in the variable Z. Leading and trailing zeros can be left off.

If current value

>

final value,
continue loop.

1

1

  
.

.

.

  
  
  
.

.

.

2

2

If current value

final value, exit
loop.

If current value

final value,
continue loop.

1

1

  
.

.

.

  
  
  
.

.

.

2

2

If current value

>

final value, exit
loop.

Advertising