HP 9000 200 Series Manual page 141

Using the basic 5.0/5.1 system
Table of Contents

Advertisement

The following program shows the indentation performed by this command:
INDENT 7,2
the first parameter (7) indicates the indentation of the "outermost" program segment,
and the second parameter (2) shows how many additional spaces each subsequently
nested segment is indented. Notice how easy it is to follow the logic flow?
10
FOR 1=1 TO 5
20
REPEAT
30
INPUT "How old are you?",Age
40
Reasonable=l! Assume they're telling the truth ...
50
IF Age<O THEN
60
DISP "A negative age implies you are not born."
70
Reasonable=O
BO
ELSE
90
IF Age>120 THEN
100
DISP "Are you sure?!"
110
Reasonable=O
120
ELSE
130
IF Age>100 THEN
140
DISP "You are pretty spry!"
150
ELSE
160
IF Age>BO THEN
170
DISP "Wow! Most people your age don't use computers much."
lBO
ELSE
190
DISP "Glad to meet you."
200
END IF
210
END IF
220
END IF
230
END IF
240
WAIT 4
250
UNTIL Reasonable
260
DISP "You were";Age*365.2422;" days old on your last birthday."
270
WAIT 3
2BO
NEXT I
290
END
6-20
Editing and Storing Programs

Advertisement

Table of Contents
loading

This manual is also suitable for:

9000 300 series

Table of Contents