BASIC Keywords

Notes on Source:

•   Says where this particular keyword was first used.

•   Abbreviations used: "AB" = A-BASIC; "Plus" = A-BASIC Plus.

Notes on Switches:

•   The column entry shows the compiler switch(es) required to enable this feature.

•   When more than one switch is listed, "or" is implied—i.e., just one of the switches is required.

 

Keyword

Source

Switches

Description

ABS

AB

 

See Numeric Functions.

.ACCOUNT

A-Shell

X:2

See Dot Variables.

ACS

AB

 

See Trigonometric Functions.

ALLOCATE

AB

 

Allocate a random file.

AMOS

Plus

X:1

Execute AMOS commands as subroutines.

AND

AB

 

See Expressions.

.ARGCNT

A-Shell

X:2

See Dot Variables.

.ARGSIZ

A-Shell

X:2

Returns the size of the specified argument passed to the current SBX, function, or procedure.

.ARGTYP

A-Shell

X:2

Returns the type of the specified argument passed to the current SBX, function, or procedure.

ASC

AB

 

See String Functions.

ASN

AB

 

See Trigonometric Functions.

ATN

AB

 

See Trigonometric Functions.

AUTO_EXTERN

A-Shell

X:2

Enables or disables the visibility of variables defined globally.

AUTOCAP

d/BASIC

 

See String Functions.

BYTE

AB

 

BYTE(X) reads memory-mapped ports.

CALL

AB

 

Unstructured subroutine call.

CASE

Plus

X:1, RC

Label option within SWITCH.

CHAIN

AB

 

Provides the ability to pass command line arguments. CHAIN <string expr> is supported in all compiler modes, including the ability to include command line arguments in the <string expr>, which must start with a program name, optionally followed by an arbitrary string of arguments, e.g. CHAIN "progxx /hard and /fast". Use CMDLIN or LSTLIN.SBR to retrieve the parameters in the target program.

CHR$

AB

 

See String Functions.

.CLEAR

A-Shell

X:2

Removes all the elements of the array without destroying the array itself.

CLOSE

AB

 

Close file.

CMDLIN

Plus

X:1

Retrieve command line.

COS

AB

 

See Trigonometric Functions.

DATA

AB

 

List of data elements with program.

DATE

AB

 

See System Functions.

.DATE

A-Shell

X:2

See Dot Variables.

DEBUG

A-Shell

X:2

See TRACE and DEBUG Statements.

DEFAULT

Plus

X:1, RC

Default label option within SWITCH.

DEFINE

Plus

X:1, RC

Define a symbolic constant.

DEFSTRUCT

A-Shell

X:2

Define a structure.

DEFTYPE

A-Shell

X:2

Defines an alias for a data type.

.DEVICE

A-Shell

X:2

See Dot Variables.

DIM

AB

 

Dimension an array at runtime. Deprecated; use DIMX.

DIMX

A-Shell

X:2

Enhanced dynamic array allocation. See Dynamic Arrays (DIMX).

DIVIDE’BY’0

Plus

X:1

Treat division by zero as zero rather than error. See NO'DIVIDE'BY'0.

DO

Plus

X:1, RC

Repeat loop while (or until) a condition is (or becomes) true. See DO / WHILE / UNTIL.

Dot Variables

A-Shell

X:2

Read-only system variables.

DPRINT

A-Shell

X:2

Like PRINT but creates a static text control using the current default GUI (proportional) font and with the sunken attribute. Intended for displaying data fields.

ECHO

Plus

X:1

Set terminal echo mode; same as XCALL ECHO.

EDIT$()

Plus

X:1

See String Functions.

++ELIF...

 

 

See Conditional Compilation.

ELSE

AB

 

Final alternative clause within IF statement, which see.

ELSEIF

A-Shell

X:2, RC

Intermediate alternative clauses within IF statement. See ELSEIF Clauses .

END

AB

 

Terminate execution of program.

ENDFUNCTION

A-Shell

X:2

Marks end of a function.

ENDIF

 

 

See IF … ENDIF.

ENDPROCEDURE

A-Shell

X:2

Marks end of a procedure.

ENDSTRUCT

A-Shell

X:2

See DEFSTRUCT.

ENDSWITCH

Plus

X:1, RC

End of SWITCH statement.

EOF

AB

 

See File-Related Functions.

EQV

AB

 

See File-Related Functions.

ERF

AB

 

See File-Related Functions.

ERR

AB

 

See System Functions.

ERRMSG

Plus

X:1

See System Functions. Returns the text of the error message associated with the specified error number from the sys:errmsg.xxx file.

++ERROR

A-Shell

X:2

Force error within compilation. Also see ++MESSAGE.

$EXIT

A-Shell

X:2

Special exit label within function / procedure.

EXIT

Plus

X:1

Exit from inner-most loop or block (DO, FOR, SWITCH).

EXITFUNCTION

A-Shell

X:2

Exit the current function.

EXITPROCEDURE

A-Shell

X:2

Exit the current procedure.

EXP

AB

 

See Numeric Functions.

.EXPERIENCE

A-Shell

X:2

See Dot Variables.

.EXTENT

A-Shell

 

Returns the "extent" of the subscript number.

++EXTERN

A-Shell

X:2

Exposes individual global variables.

FACT

AB

 

See Numeric Functions.

.FALSE

A-Shell

X:2

See Dot Variables.

FILEBASE

AB

 

Set numeric offset for first file record.

FILL$()

Plus

X:1

Copies the given expression, partially or multiple times, up to the specified length. See String Functions.

FIX

AB

 

See Numeric Functions.

FOR

A-Shell

X:2

See FOR … NEXT.

AB

 

FOREACH

A-Shell

X:2

Used to iterate through Ordered Maps.

FUNCTION

A-Shell

X:2

Begin definition of function.

GETKEY()

Plus

X:1

Input a character.

GOSUB

AB

 

Same as CALL.

GOTO

AB

 

Jump to specified line number or label.

IF

AB

 

Traditional form of IF statement.

Plus

X:1, RC

Block-structured form of traditional IF statement; see IF … ENDIF.

++IF

 

 

See Conditional Compilation.

++INCLUDE

AB

 

Include specified file at compile time; see INCLUDE.

A-Shell

X:2

INPUT

 

 

Input field(s) from keyboard or file; see INPUT.

INSTR

AB

 

Substring search; see INSTR().

A-Shell

X:2

Extended version substring search; INSTR().

.INSTRR

A-Shell

X:2

Searches a string for a pattern, like INSTR(), but in reverse.

INT

AB

 

See Numeric Functions.

IO

AB

 

IO(X) pseudo reads from memory-mapped I/O port.

.ISNULL

A-Shell

X:2

Tests for the NULL condition. See Ordered Maps > Special ORDMAP Functions.

.JOBNAME

A-Shell

X:2

See Dot Variables.

.KEY

A-Shell

X:2

Returns the key associated with the element currently indexed by the iterator. See Ordered Maps > Special ORDMAP Functions.

KILL

AB

 

Delete a file.

.LAST_LABEL

A-Shell

X:2

See Dot Variables.

.LAST_ROUTINE

A-Shell

X:2

See Dot Variables.

LCS$

AB

 

See String Functions.

LEFT$

AB

 

See String Functions.

LEN

AB

 

See String Functions.

LET

AB

 

Assignment statement.

.LINENO

A-Shell

X:2

See .LINENO, .PAGENO.

LOG

AB

 

See Numeric Functions.

LOG10

AB

 

See Numeric Functions.

LOOKUP

AB

 

Return size of file in blocks. See File-Related Functions.

LOOKUP ("fspec")

 

 

Function version of LOOKUP statement.

LOOP

Plus

X:1, RC

See DO / WHILE / UNTIL.

MAP Statement

AB

 

Variable declaration.

MAX

AB

 

See Expressions.

MEM

AB

 

See System Functions.

++MESSAGE

A-Shell

X:2

Output message during compilation. Also see ++ERROR.

MID$

AB

 

See String Functions.

MIN

AB

 

See Expressions.

.MONTH

A-Shell

X:2

See Dot Variables.

.NEST_LEVEL

A-Shell

X:2

See Dot Variables.

.NEXT

A-Shell

X:2

See Ordered Maps > Special ORDMAP Functions.

NO’DIVIDE’BY’0

Plus

X:1

Force divide by zero to generate error 10 (default). See DIVIDE'BY'0.

NOECHO

Plus

X:1

Set terminal noecho mode. Same as XCALL NOECHO.

NOT

AB

 

See Expressions.

.NULL

A-Shell

X:2

See Ordered Maps > Special ORDMAP Functions.

ODTIM()

Plus

X:1

See String Functions.

.OFFSET

A-Shell

X:2

Returns the offset to the specified member variable within the specified structure.

.OFFSIZ$

A-Shell

X:2

Returns the combination of the specified structure member's offset and size.

ON - GOSUB

AB

 

Call one of list of subroutines, based on value.

ON - GOTO

AB

 

Goto one of list of labels, based on value.

ON ERROR GOTO

 

 

Specify error handling routine.

OPEN

AB

 

Open file.

OPEN for APPEND

Plus

X:1

Enhancement to OPEN #CH, FSPEC, APPEND.

OR

AB

 

See Expressions.

PAD

AB

 

See String Functions.

PAD()

A-Shell

X:2

Pad a string with spaces (function).

.PAGENO

A-Shell

X:2

See .LINENO, .PAGENO.

.PGMNAME

A-Shell

X:2

See Dot Variables.

.PGMVERSION

A-Shell

X:2

See Dot Variables.

POP

d/BASIC

 

Pops the current GOSUB return address from the stack. Deprecated.

++PRAGMAs

Plus

X:1

Compiler Directives.

PRINT

AB

 

Output variables and expressions to screen or file.

PROCEDURE

A-Shell

X:2

Start definition of a procedure.

PROGRAM

AB

 

Program header declaration.

RANDOMIZE

AB

 

Initialize Random Number Generators—both RND(x) and RND2()—using a randomly selected seed.

READ

AB

 

Read from file.

READL

AB

 

Read record and lock. See file access statements

READ'ONLY

 

 

File open mode modifier. See OPEN.

REDIMX

 

X:2

Re-dimensions an array originally created with Dynamic Arrays (DIMX).

REPEAT

Plus

X:1, RC

Jump to top of loop structure to begin next iteration.

RESTORE

AB

 

Reset DATA access pointer to beginning.

RESUME

AB

 

Resume to line after last error.

RESUME WITH ERROR

A-Shell

X:2

Special version of resume used with functions and procedures.

RETURN

AB

 

Return from unstructured subroutine (see GOSUB, CALL).

A-Shell

X:2

Return value from XFUNC.

RIGHT$

AB

 

See String Functions.

RND

AB

 

See Numeric Functions.

RND2

A-Shell

X:2

See Numeric Functions.

RTRIM

AB

 

See String Functions.

SCALE

AB

 

Declare scaled arithmetic.

SGN

AB

 

See Numeric Functions.

SIGNIFICANCE

AB

 

Set output/format significance of floating point values.

SIN

AB

 

See Trigonometric Functions.

.SIZEOF

A-Shell

X:2

Returns size of previously mapped variable.

SLEEP

Plus

X:1

Sleep for specified seconds. Same as XCALL SLEEP.

SPACE

AB

 

See String Functions.

SQR

AB

 

See Numeric Functions.

SRND2

A-Shell

X:2

See Numeric Functions.

STEP

AB

 

Set loop counter increment. See FOR … NEXT.

STOP

AB

 

Program stop, wait for CR to continue.

STR$

AB

 

See String Functions.

STRSIZ

AB

 

Sets the default length of string variables.

STRIP

AB

 

See String Functions.

STRIP

Plus

X:1

Returns var with all trailing spaces removed. Also STRIP$(var).

STRSIZ

AB

 

Sets the default length of string variables.

SWITCH

Plus

X:1, RC

Conditional execution based on value of an expression.

TAB(X,Y,Z)

A-Shell

X:2

Extension of tab(x,y) with z indicating attributes to assign to the subsequent text.

TAN

AB

 

See Trigonometric Functions.

.TERMINAL

A-Shell

X:2

See Dot Variables.

THEN

AB

 

Separates IF condition from statement. See IF.

TIME

AB

 

See System Functions.

TO

AB

 

See FOR … NEXT.

TPRINT

A-Shell

X:2

See Expressions.

TRACE

A-Shell

X:2

See TRACE and DEBUG Statements.

.TRUE

A-Shell

X:2

See Dot Variables.

UCS$

AB

 

See String Functions.

UNLOKR

AB

 

Release lock on file or record.

UNTIL

Plus

X:1, RC

Repeat loop while (or until) a condition is (or becomes) true. See DO / WHILE / UNTIL.

.USERNAME

A-Shell

X:2

See Dot Variables.

USING

AB

 

See Expressions.

VAL

AB

 

See Numeric Functions.

VXCALL

A-Shell

X:2

Varition of XCALL that uses a string expression for the subroutine name, rather than a literal.

WEND

d/BASIC

/D

Same as ENDIF.

WHEN

d/BASIC

/D

Same as IF.

WHILE

Plus

X:1, RC

Repeat loop while (or until) a condition is (or becomes) true. See DO / WHILE / UNTIL.

WORD

AB

 

WORD(X) reads memory-mapped ports.

WRITE

AB

 

Write to random file.

WRITECD

A-Shell

X:2

Output comma delimited values.

WRITEL

AB

X:1

Write record not previously locked.

WRITELN

Plus

X:1

Same as WRITEL but leave record locked.

WRITEN

Plus

X:1

Same as WRITEL but leave record locked.

WRITETD

A-Shell

X:2

Deprecated; see WRITECD for important note.

XCALL

AB

 

Call external subroutine.

XFUNC

A-Shell

X:2

Call an external (SBX) function.

XGETARG(S)

A-Shell

X:2

Retrieve subroutine parameters. See X-ARGs.

XOPEN

A-Shell

X:2

Variation on OPEN statement fo ISAM-A.

XOR

AB

 

See Expressions.

XPUTARG

A-Shell

X:2

Return subroutine parameters. See X-ARGs.

XREAD, XWRITE, XUNLOKR

A-Shell

X:2

Allow record access via explicit record numbers.

.YYMMDD

A-Shell

X:2

See Dot Variables.