Keywords allow a program to communicate with SNOBOL4. Their names are set apart from other variables by the unary operator ampersand (&). Protected keywords cannot be changed by a program, while unprotected keywords can.
Several protected keywords can be traced using the TRACE function: &ERRTYPE, &FNCLEVEL, &STCOUNT, and &STFCOUNT. Tracing occurs each time SNOBOL4 alters their value. For example, tracing keyword &STCOUNT produces a trace after every SNOBOL4 statement is executed.
The primitive pattern ABORT.
String of 256 ASCII character values in ascending order.
The primitive pattern ARB.
The primitive pattern BAL.
String containing most recent system generated error text.
Integer code of the last execution error to occur. This keyword may be traced with function TRACE().
The primitive pattern FAIL.
The primitive pattern FENCE.
Integer depth of program-defined function calls. It is initially zero, and incremented by one for each function call, and decremented for each function return. This keyword may be traced.
Integer statement number of the previous statement executed.
The 26 lower-case alphabetic letters.
The command string used to invoke SNOBOL4. Begins with the blank following the word SNOBOL4.
The primitive pattern REM.
Contains a string describing the type of return most recently made by a program-defined function, either 'RETURN', 'FRETURN', or 'NRETURN'.
Integer count of the number of statements executed. This keyword may be traced. Since integers are 16-bit quantities, executing more than 32,767 statements will cause this keyword to overflow. No harm results, and the keyword may still be traced, but its value will be a large negative number.
Integer count of the number of statements which failed. This keyword may be traced. The same overflow problem discussed for &STCOUNT occurs with this keyword.
Integer statement number of the current statement being executed.
The primitive pattern SUCCEED.
The 26 upper-case alphabetic letters.
Nonzero for anchored pattern match. Initially 0, unanchored.
Zero to prevent case-folding during compilation with the functions CODE and EVAL. Initially 1, causing case-folding to occur.
The end-of-job code is an integer value in the range 0 to 255 returned to the operating system. It can be tested with the DOS Batch condition ERRORLEVEL. Initially 0.
Nonzero to list unprotected keywords and variables with nonnull values at program termination. A positive value causes the list to be sorted; negative values leave them unsorted. Initially 0. The dump is produced to I/O unit 6 (OUTPUT).
Determines the number of conditionally fatal execution errors permitted before terminating a program. The Execution Error Messages section of Chapter 7 of the companion tutorial, "System Messages," describes the errors which are conditionally fatal. Initially 0, causing SNOBOL4 to stop if any error occurs.
Nonzero value causes each call and return of a program-defined function to be listed. Decremented for each trace. Initially 0.
Nonzero to disable pattern matching heuristics. Initially 0, the quickscan mode of pattern matching.
Zero to disable all input. When disabled, using variable INPUT (or other input-associated variables) does not read data from the file. Initially 1, input is enabled.
Maximum string length. Initially 5000, maximum value is 32767. Memory limitations in Vanilla SNOBOL4 will limit actual strings to a smaller size.
Zero to disable all output. When disabled, assigning data to OUTPUT or SCREEN (or other output-associated variables) does not write data to the file. Initially 1, output is enabled.
The number of statements allowed to execute. If positive, it is decremented for each statement executed; execution terminates when it reaches 0. If negative, there is no limit, and it is not decremented. Initially -1.
Nonzero to permit tracing with the TRACE function. Initially 0, it is decremented for each trace performed.
Nonzero to strip trailing blanks from lines read from ASCII files. This is faster than using the TRIM function. It does not strip trailing tab characters. Initially 0: blanks are not removed and short records are blank padded to the file's standard record length.
This is a special label which denotes the last statement of the user's program. An optional label may follow the word END (in the subject field) to denote where program execution is to begin. A program should terminate execution by transferring to label END.
Transfer to this label to return from a program-defined function with a failure indication.
Variable associated with input from unit number 5.
Transfer to this label to return successfully from a program-defined function by name, rather than by value. The function name should be assigned a name result (usually with the period (.) unary operator). This permits a function call to be the object of an assignment operation.
Variable associated with output to unit number 6.
Transfer to this label to return from a program-defined function with a success indication. A value may be returned as the function's result; simply assign it to a variable with the same name as the function before transferring to RETURN.