Please enable JavaScript to view this site.

A-Shell Reference

Notes:

1.The "Switches" column shows the compiler switch(es) required to enable this feature.
2.When more than one switch is listed, "or" is implied—i.e., just one of the switches is required.
3.Some keywords ("Note 3" references below) behave differently depending on the compiler switch specified; see topic link for details.
4.Although not listed here, both System-Defined Functions and Dot Variables are also effectively keywords in that they cannot be used as custom variable names.

Keyword

Switches

Category

Description

ALLOCATE

 

File I/O Statement

Allocate a random file.

AMOS

X:1

Control Statement

Execute AMOS commands as subroutines.

AND

 

Operator

Logical AND.

AUTO_EXTERN

X:2

 

Enables or disables the visibility of variables defined globally.

.BINDSTRUCT

X:2

Dyn Struct Statement

Binds the specified DYNSTRUCT variable to the structure definition.

BYTE

 

 

BYTE(x) reads memory-mapped ports.

CALL

 

Control Statement

Unstructured subroutine call.

CASE

X:1, RC

Control Struc Stmt

Label option within SWITCH.

CHAIN

 

 

Provides the ability to pass command line arguments.

.CLEAR

X:2

Array Statement

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

CLOSE

 

File I/O Statement

Close file.

CMDLIN

X:1

 

Retrieve command line.

DATA

 

General Statement

List of data elements with program.

DATE

 

System Variable

Returns system date.

DEBUG

X:2

 

 

DEFALIAS

 

Compiler Directive

Allows aliases to be defined for the names of functions and procedures.

DEFAULT

X:1, RC

 

Default label option within SWITCH.

DEFINE

X:1, RC

Compiler Directive

Define a symbolic constant.

DEFSTRUCT

X:2

Compiler Directive

Define a structure.

DEFTYPE

X:2

Compiler Directive

Defines an alias for a data type.

DIM

 

 

Deprecated; use DIMX instead. Dimension an array at runtime.

DIMX

X:2

 

Enhanced dynamic array allocation.

DIVIDE’BY’0

X:1

 

Treat division by zero as zero rather than error.

DO

X:1, RC

Ctrl Struct Statement

Repeat loop while (or until) a condition is (or becomes) true.

DPRINT

X:2

 

Like PRINT but creates a static text control.

ECHO

X:1

 

Set terminal echo mode; same as Xcall ECHO.

++ELIF

 

 

Conditionals based on evaluating a constant expression.

ELSE

 

Ctrl Struct Statement

Final alternative clause within an IF statement.

ELSEIF

X:2, RC

Ctrl Struct Statement

Intermediate alternative clauses an IF statement.

END

 

Control Statement

Terminate execution of program.

ENDFUNCTION

X:2

 

Marks end of a function.

ENDIF

 

Ctrl Struct Statement

Terminates IF...ENDIF blocks.

ENDPROCEDURE

X:2

 

Marks end of a procedure.

ENDSTRUCT

X:2

 

End of a DEFSTRUCT ... ENDSTRUCT block.

ENDSWITCH

X:1, RC

 

End of SWITCH statement.

EQV

 

Operator

Logical equivalence.

++ERROR

X:2

 

Force error within compilation.

$EXIT

X:2

 

Special exit label within function / procedure.

EXIT

X:1

Control Statement

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

EXITFUNCTION

X:2

Control Statement

Exit the current function.

EXITPROCEDURE

X:2

Control Statement

Exit the current procedure.

EXITPROGRAM

X:2

Control Statement

Exit the current function or procedure to label $EXITPROGRAM

++EXTERN

X:2

 

Exposes individual global variables.

FILEBASE

 

File I/O Statement

Set numeric offset for first file record.

FOR

Note 3

Ctrl Struct Statement

 

FOREACH

X:2

Ctrl Struct Statement

Used to iterate through Ordered Maps.

.FSTAT

X:2

 

Returns file status for the last ISAM-A operation on the specified channel.

FUNCTION

X:2

 

Begin definition of function.

GOSUB

 

Control Statement

Same as CALL.

GOTO

 

Control Statement

Jump to specified line number, label or variable.

GRIDMAP

X:2

GRIDMAP

A variation of ordered map with two keys and one value.

IF

Note 3

Ctrl Struct Statement

Traditional form of IF statement, and block-structured form of IF … ENDIF.

++IF

 

Ctrl Struct Statement

 

++INCLUDE

Note 3

 

Include specified file at compile time.

INPUT

 

File I/O Statement

Input field(s) from keyboard or file.

INDEXED

 

File I/O Statement

File OPEN for ISAM or for ISAM-A mode.

INDEXED'EXCLUSIVE

 

File I/O Statement

File OPEN for ISAM or for ISAM-A mode.

IO

 

 

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

ISAM'INDEXED

 

File I/O Statement

File OPEN for ISAM mode.

ISAM'INDEXED'EXCLUSIVE

 

File I/O Statement

File OPEN for ISAM mode.

ISAMP'INDEXED

 

File I/O Statement

File OPEN for ISAM-A mode.

ISAMP'INDEXED'EXCLUSIVE

 

File I/O Statement

File OPEN for ISAM-A mode.

.KEY

X:2

 

May be appended to an ordered map iterator, i.e. $$iKEY, to reference the key associated with that interator. $$i.KEY is equivalent to .KEY($$i).

KILL

 

File I/O Statement

Delete a file.

LET

 

 

Assignment statement.

LOCK

 

 

 

LOOKUP

 

 

Return size of file in blocks.

LOOP

X:1, RC

 

 

MAP

 

 

Variable declaration.

MAX

 

Operator

Maximum of two operands.

++MESSAGE

X:2

 

Output message during compilation. Also see ++ERROR.

MIN

 

Operator

Minimum of two operands.

MLIST

X:2

Multi-level List

A bidirectional linked list.

MOD

 

Operator

Modulo.

NO’DIVIDE’BY’0

X:1

 

Force divide by zero to generate error 10 (default).

NOECHO

X:1

 

Set terminal noecho mode. Same as Xcall NOECHO.

NOT

 

Operator

Logical NOT.

ON - GOSUB

 

 

Call one of list of subroutines, based on value.

ON - GOTO

 

 

Goto one of list of labels, based on value.

ON ERROR GOTO

 

Control Statement

Specify error handling routine.

OPEN

 

File I/O Statement

Open file.

OPEN for APPEND

X:1

 

Enhancement to OPEN #CH, FSPEC, APPEND.

OR

 

Operator

Logical OR.

ORDMAP

X:2

 

An associative array that maps keys to values

ORDMAPM

X:2

 

Same as ORDMAP but supports multiple keys of the same value.

POP

 

 

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

.POPBACK

X:2

Multi-level List

Remove last element from an MLIST.

.POPFRONT

X:2

Multi-level List

Removes first element from an MLIST.

++PRAGMAs

X:1

 

Compiler Directives.

PRINT

 

File I/O Statement

Output variables and expressions to screen or file.

PROCEDURE

X:2

 

Start definition of a procedure.

PROGRAM

 

 

Program header declaration.

RANDOMIZE

 

Numeric Function

Initialize Random Number Generator with a randomly selected seed.

READ

 

File I/O Statement

Misc Statement

Read record from file or from embedded DATA statement.

READL

 

File I/O Statement

Read record and lock. See file access statements

READ'ONLY

 

File I/O Statement

File OPEN mode modifier.

READ'READ'ONLY

X:2

File I/O Statement

Read record, explicitly without locking.

REDIMX

X:2

Array Statement

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

REPEAT

X:1, RC

Control Statement

Jump to top of loop structure to begin next iteration.

RESTORE

 

General Statement

Reset DATA access pointer to beginning.

RESUME

 

Control Statement

Resume execution after trapping an error.

RESUME WITH ERROR

X:2

Control Modifier

Modifier for RESUME within an error trap in a function

RETURN

Note 3

Control Statement

Return from unstructured subroutine. Also return value from XFUNC().

SCALE

 

 

Declare scaled arithmetic.

SET'RECNO

X:2

File I/O Statement

Sets the record number of a file.

SIGNIFICANCE

 

General Statement

Set output/format significance of floating point values.

SLEEP

X:1

General Statement

Sleep for specified seconds. Same as Xcall SLEEP.

.SORT

X:2

Multi-level List

Sort elements in MLIST by value.

SPAN

 

File I/O Statement

File OPEN mode modifier.

.SPLICE

X:2

Multi-level List

Splice elements from one MLIST to another.

STEP

 

 

Set loop counter increment.

STOP

 

Misc Statement

Program stop, wait for CR to continue.

STRSIZ

 

Compiler Directive

Sets the default length of string variables.

.SUBLIST

X:2

Multi-level List

Specify sublist of element.

SWITCH

X:1, RC

Ctrl Struct Statement

Conditional execution based on value of an expression.

TAB

 

 

Convert high-level display commands into ESCAPE sequences for terminal.

THEN

 

Ctrl Struct Statement

Separates IF condition from statement.

TIME

X:2

System Function

Returns system time in number of seconds since midnight.

TO

 

Ctrl Struct Statement

 

TPRINT

X:2

 

See Expressions.

TRACE

X:2

 

 

UNDEF

 

Compiler Directive

Cancels (UNDEFines) a symbol created by a prior DEF... directive.

UNLOKR

X:2

File I/O Statement

Release lock on file or record.

UNTIL

X:1, RC

Ctrl Struct Statement

Repeat loop while (or until) a condition is (or becomes) true.

USING

 

Operator

Formatting by template.

VXCALL

X:2

 

Same as XCALL but uses a string expression for the subroutine name.

WEND

/D

 

Same as ENDIF.

WAIT'FILE

 

File I/O Statement

File OPEN mode modifier.

WAIT'RECORD

 

File I/O Statement

File OPEN mode modifier.

WHEN

/D

 

Same as IF.

WHILE

X:1, RC

Ctrl Struct Statement

Repeat loop while (or until) a condition is (or becomes) true.

WITH_ERROR

X:2

Modifier

Modifier for RESUME within an error trap in a function.

WORD

 

 

WORD(X) reads memory-mapped ports.

WRITE

 

File I/O Statement

Write to random file.

WRITECD

X:2

File I/O Statement

Output comma delimited values.

WRITEL

X:1

File I/O Statement

Write record not previously locked.

WRITELN

X:1

File I/O Statement

Same as WRITEL but leave record locked.

WRITEN

X:1

File I/O Statement

Same as WRITE but leave record locked.

WRITETD

X:2

 

Deprecated; see WRITECD.

XCALL

 

 

Call subroutine.

XGETARG(S)

X:2

General Statement

Retrieve subroutine parameters.

XOPEN

X:2

File I/O Statement

Variation on OPEN statement fo ISAM-A.

XOR

 

Operator

Logical XOR; exclusive OR.

XPUTARG

X:2

General Statement

Return subroutine parameters.

XREAD, XWRITE, XUNLOKR

X:2

File I/O Statement

Allow record access via explicit record numbers.