Download BASIC Programming Guide

Transcript
30
BASIC Programming Guide For Use with CipherLab BASIC Compiler
The DIM statement sets all the elements of the specified arrays to an initial value of
zero or empty string.
Note that the maximum allowable number of dimensions for an array is 2.
Example
DIM A(10), B%(20), C$(30,10)
GOSUB
Purpose
To call a specified subroutine.
Syntax
GOSUB SubName|SubLabel
Remarks
"SubName" is the name of a subroutine.
"SubLabel" is the line label of a subroutine.
Example
GOSUB DoIt
...
GOSUB Done
...
SUB DoIt( )
PRINT "Now I've done it!"
END SUB
...
Done:
PRINT "Now I've done it!"
RETURN
GOTO
Purpose
To branch out unconditionally to a specified line number of line label from the
normal program sequence.
Syntax
GOTO LineNumber|LineLabel
Remarks
"LineNumber" is the integer number in front of a program line.
"LineLabel" is the string label of a program line.
Example
Loop:
GOTO Loop
INT
Purpose
To return the largest integer that is less than or equal to the given numeric
expression.