Casio FX-890P Owner's Manual page 51

Casio personal computer owner's manual
Table of Contents

Advertisement

ON GOTO
PURPOSE: Jumps to a specified branch destination in accordance with a specified
branching condition.
FORMAT:
ON
Condition
Numeric expression
EXAMPLE: ON A GOTO 100, 200, 300
PARAMETERS:
1. Branch condition: Numeric expression truncated to an integer
2. Branch destination line number: integer in the range of 1≤ line number ≤65535
3. Program area number: single character, 0-9
4. Label: Name of a label in the program.
EXPLANATION:
1. The GOTO statement is executed in accordance with the value of the
expression used for the branch condition. For example, execution jumps to the
first branch destination when the value is 1, to the second destination when
the value is 2 etc.
2. Program execution does not branch and execution proceeds to the next
statement when the value of the condition is less than 1, or if a branch
destination corresponding to the value does not exist.
3. Up to 99 branch destinations may be specified.
SAMPLE PROGRAM:
10 INPUT "1 OR 23;A
20 ON A GOTO 40,50
30 END
40 PRINT "ONE":END
50 PRINT "TWO"
Execution jumps to line 40 if 1 .
SEE: ON GOSUB
branch destination line number
GOTO [
# program area number
branch destination line number
[ , [
.
is entered or to line 50 if 2 .
Line number
Single character; 0-9
*Label
Label name
Line number
# program area number
Single character; 0-9
*Label
Label name
51
P
0
]
] ]*
.
is entered.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Z-1grZ-1

Table of Contents