892 J006 MNAH | PGC5000 G EN 2 | 125
Raises e to the power of floating point variable T and assigns it to floating point
variable A.
7.4.25 FOR . . . NEXT statements
Description: Does an iteration loop.
Syntax: FOR variable = initial x TO y [STEP z] NEXT [variable, variable]
Comments: variable is an integer used as a counter.
x is the initial value of the counter.
y is the final value of the counter.
z is the increment for the counter.
Example: 0010 FOR I = 100 TO -100 STEP -2
0020 NEXT
Executes loop 101 times with loop counter values of 100, 98, …, -98, and -100.
7.4.26 GOSUB statement
Description: Branches to subroutine.
Syntax: GOSUB Line
RETURN
Comments: line is the statement number for the subroutine.
Example: 0010 GOSUB 100
0020 END
0030 100 RETURN
Branches to subroutine at statement 100. Subroutine returns execution at statement
20 which ends execution.
7.4.27 GOTO statement
Description: Branches to label.
Syntax: GOTO ProgramLabel:
Comments: Program Label: is the label where execution will continue.
7.4.28 IF statement
Description: Allows for alternative paths of execution based on the evaluation of an expression.
Syntax: IF expression THEN
statements
ELSE
statements
ENDIF
Comments: expression is a logical expression whose result is TRUE or FALSE. statements is a
single or multiple statement.
Example: 0010 IF A = 1 AND B = 2 THEN 0020 LPRINT “ONE”
0030 ELSE
0040 LPRINT “TWO”
0050 ENDIF
If the expression is true, “ONE” is printed otherwise “TWO” is printed.
7.4.29 INDICATOR function
Description: Returns the Boolean state of a GC Indicator Group. Individual indicators can be
selected by Bitwise mask. I.e. value returned is the IndicatorGroup & mask.
Syntax: INDICATOR( IndicatorGroup$, mask )