Basic AL intrinsics


Set (any inout a1, a2)
The assignment operation a1=a2 for any variables of the same type.

Set (any list l1, l2)
The assignment operation l1=l2, for any lists of the same type. The two lists will become exact but distinct copies; they will not share elements.

Query (string inout s1, s2; logical inout b)
Outputs the question in string s2 to the user, and waits for an answer, which is put into string s1. The answer is expected from the graphics if in graphics mode, otherwise from the tty. The logical b becomes true if the user picks abort in the graphics menu, otherwise it is false.

Echo (string s)
Outputs the string to the tty.

Error (string s)
Outputs the string as an error message to the tty.

Abort ()
Generates an abort signal as if the user picked abort in the graphics menu.

Crash (string s)
Outputs the string as an error message, and then makes the AL machine crash, as if an invalid operation was made.

CPU_time () result real
Return the CPU time (seconds) spent by the ANSIG process since the session was started.

Open (integer inout i; string s; logical b)
Opens the file with the name s. The file is opened for read if the logical b is false, otherwise the file is opened for write. An existing file opened for write is overwritten. The file identifier is returned in the integer i. If the integer i is 0, then the file could not be opened.

Read (integer i; string inout s; logical inout b)
Read a line into the string s from the file identified by the integer i. If there was a read error, the logical b is set to true.

Scan (integer i)
Define the file identified by the integer i to be the current scan file. The file i must have been opened for read.

Scan (string inout s; integer inout i; logical inout b)
Return the next item from the scan file. The string s contains the item, while the integer i contains the type of the item: 0=ordinary, 1=delimiter, 2=string. If there is a read error, then the logical b is set to true. When end-of-file is reached, the returned string becomes empty.

Write (integer i; string s; logical inout b)
Write the contents of string s to the file identifier by the integer i. If there was a write error, the logical b is set to true.

Close (integer i)
Close the file identified by the integer i.

Symbol (string inout s1, s2; logical b)
Put the value of the variable s2 in string s1, if the symbol exists and is a variable. The logical b contains true if variable does not exist.

Symbol (any list al; string s; logical b)
Put the list elements of the symbol in string s, if the symbol exists and is of the right list type. The logical b contains true if the list does not exist or is of the wrong type.

Set_symbol (string s1, s2)
Set the value of the symbol s1 to be the contents of string s2. If symbol clobber is not allowed, and the symbol exists, then an error occurs.

Set_symbol (string s; any list al)
Puts the contents of the list into the symbol s. If symbol clobber is not allowed, and the symbol exists, then an error occurs.

Read_symbols (string s; logical inout b)
Reads all symbols in file with the name s. If there was an error, then the logical b is set to true.

Write_symbols (string s; logical inout b)
Writes out all symbols to the file with the name s. If there was an error, then the logical b is set to true.

Delete (string s)
Delete the symbol with the name s (either list or variable), if it exists.

Environment (string s) result string
Returns the value of the operating system environment variable s.

Per Kraulis 18 Apr 1996.