Lobo BASIC Reference Manual
- REM
Ignore this line.
Example:
(100 REM arkable!!! program by D. Feinberg)
- LET =
Evaluate <expr> and assign it to <id>.
Example:
(900 LET A = ((8 * D) - 1))
- PRINT ...
Evaluates and displays <expr 1> <expr 2>...<expr n>
on a single line (no intervening spaces) and then prints a
carriage return. Example:
(500 PRINT "A =" 4)
- PRINT! ...
Evaluates and displays <expr 1> <expr 2>...<expr n>
on a single line (no intervening spaces). Example:
(230 PRINT! (X + 1))
- INPUT
Displays <string> followed by a question mark. User input is
assigned to <id>. Example:
(120 INPUT "WHAT IS YOUR HEIGHT IN INCHES" H)
- END
Terminates program.
- IF THEN
Evaluates <bool expr>. If <bool expr> evaluates to true,
executes <stmt> Example:
(200 IF (A <> 1) THEN LET A = 1)
- IF THEN
Evaluates <bool expr>. If <bool expr> evaluates to true,
control jumps to <line num>. Example:
(200 IF (X <= (Y * 7)) THEN 100)
- GOTO
Control jumps to <line num>. Example:
(200 GOTO 100)
- FOR = TO
Initializes <id> to <int expr 1>. Example: See NEXT.
- NEXT
Increments <id>. If <id> is less than or equal to
<int expr 2> in matching FOR statement, control jumps
to line number immediately following matching FOR. Example:
((10 FOR I = 1 TO (K + 1))
(20 PRINT I)
(30 NEXT I))
- GOSUB
Control jumps to <line num>. See RETURN. Example:
(200 GOSUB 970)
- RETURN
Return control to line number following most recently invoked
(and not yet returned to) GOSUB.
- DIM ()
Declare one dimensional array, <id>, of size, <int expr>.
Example:
(100 DIM A(10))
- DIM ( )
Declare two dimensional array, <id>, of size, <int expr 1>
by <int expr 2>.
Example:
(100 DIM A(N (N * 2)))
- ON GOTO ...
Evaluates <int expr>. If <int expr> equals 1, control
jumps to <line num 1>, if <int expr> equals 2, control
jumps to <line num 2>, etc.
Example:
(560 ON X GOTO 100 200 300)
- ON GOSUB ...
Evaluates <int expr>. If <int expr> equals 1, control
jumps to <line num 1>, if <int expr> equals 2, control
jumps to <line num 2>, etc. See RETURN.
Example:
(560 ON (X + 3) GOSUB 1000 500 250)
- TAB()
Returns a string of spaces of length <int expr>.
- INT()
Returns floor of <int expr>.
- RND()
Returns a random number between 0 and <float expr>.
- LOG()
Returns base ten logarithm of <float expr>.
- ABS()
Returns absolute value of <float expr>.
- SQRT()
Returns square root of <float expr>.
- SIN()
Returns sine of <float expr>.
- COS()
Returns cosine of <float expr>.
- TAN()
Returns tangent of <float expr>.
- ASIN()
Returns arc sine of <float expr>.
- ACOS()
Returns arc cosine of <float expr>.
- ATAN()
Returns arc tangent of <float expr>.
- DATA ...
Numeric or string constants found on DATA lines form a list of
data items which are consumed by READ. See READ, RESTORE.
- READ
Consume a data item from the list of data items found on DATA lines.
See DATA, RESTORE. Example:
((500 DATA 5 6 7 1 2 3 4)
(510 FOR I = 1 TO 7)
(520 READ A(I))
(530 NEXT I))
- RESTORE
Restores the list of data items found on DATA lines to its initial state
(i.e., to the state which existed prior to the execution of any READ
statements). See DATA, READ.
- LEN()
Returns the length of <string expr>.
- LEFT$( )
Returns a string consisting of the first <int expr> characters of
<string expr>.
- RIGHT$( )
Returns a string consisting of the last <int expr> characters of
<string expr>.
- MID$( )
Returns the length <int expr 2> substring of
<string expr> which begins at
position <int expr 1>.