LoginLogin
Might make SBS readonly: thread

Keyword Table

Root / Documentation / [.]

Created:
A keyword is a special identifier reserved by the language syntax. They are used for control structures and special language features. A keyword cannot be used as a name for a variable or user-defined function in most cases.
Note: do not confuse keywords with operators. The "word" operators DIV MOD AND OR XOR and NOT are also treated as keywords, but are listed in the Operator Table.

Declarations/Variables

KeywordDescription
VARDeclares a variable or array.
DIM
VAR()Refer to a variable given its name as a string.
DIM()Check the dimensions of an array.
DEFStarts a function definition.
COMMONComes before DEF to mark this function as available to all slots.
INCIncrement a variable or append to a string.
DECDecrement a variable.
SWAPSwaps the values of two variables.
DEFOUTSet a return value by position. Only usable within user-defined functions.
OUTSpecifies the return value list of a function.
CONSTDeclare a constant.
ENUMDeclare an enum.

Control Structures

General

KeywordDescription
ENDEnds the program, or marks the end of a function definition.
RETURNReturns from a GOSUB or DEF. Within expression-style DEF, RETURN accepts a return value.
EXECExecutes a program or slot.
CALLCall a function given its name and parameters.
BREAKExit the loop immediately. When used with ON BREAK GOTO, specify the label to GOTO when Plus is pressed.
CONTINUESkip to the next iteration of the loop.

IF Statements

KeywordDescription
IFStarts an IF statement.
THENComes after the condition in an IF or ELSEIF (except when using GOTO.)
ELSEIFStarts an ELSEIF branch in a multi-line IF.
ELSEStarts the ELSE section of an IF statement.
ENDIFEnds a multi-line IF statement.

CASE Statements

KeywordDescription
CASEStarts a CASE statement, specifying the case value.
WHENSpecifies a possible match for the CASE statement.
OTHERWISESpecifies the path to take when nothing matches (or, matches anything.)
ENDCASEEnds the CASE statement.

LOOP

KeywordDescription
LOOPStarts a LOOP.
ENDLOOPEnds a LOOP.

FOR Loop

KeywordDescription
FORStarts a FOR loop.
TOSpecifies the end value. TO is only a keyword when used in the context of a FOR loop.
STEPSpecifies the step value. STEP is only a keyword when used in the context of a FOR loop.
NEXTEnds a FOR loop.

WHILE Loop

KeywordDescription
WHILEStarts a WHILE loop, specifying the loop condition.
WENDEnds a WHILE loop.

REPEAT Loop

KeywordDescription
REPEATStarts a REPEAT loop.
UNTILEnds a REPEAT loop, specifying the loop condition.

GOTO

KeywordDescription
GOTOJump to the given label.
GOSUBJump to the given label, as a subroutine. The label can be returned from using RETURN.
ONStarts an ON statement.

Text Screen / Console

KeywordDescription
PRINTPrint values on the console text screen.
?
TPRINTPrint values on a text screen.
T?
INPUTRead values from keyboard input on the console screen.
LINPUTRead a line of keyboard input on the console screen.
??Special alias of the INSPECT function.

DATA

KeywordDescription
DATAStarts a DATA statement.
READRead values from the current DATA position.
RESTORESet/push/pop the DATA read position.

Other

KeywordDescription
REMStarts a comment.
Small issue: The "operator table" link incorrectly points to this page instead of the operator table.

I think something went sideways with links as part of the import (all of these pages are exported from SBS2) so I'll have to fix pretty much all of them.

ohhhh um... well that's kind of unfortunate. I don't know how all the hops between new/old/sbs work, it's probably an oversight, I'm sorry.

The links were just page IDs so I don't think they could be reasonably fixed until after import, anyway.