Skip to content

SYMTAB

Program Symbol Tables

This directive is used only by utility programs, which read and modify other program files. It places in a string array the symbol tables from a program file.

SYMTAB program-specifier, string-array-name[ALL]
[,ERR=line-ref|,ERC=error-code]
program-specifier
specifies the program from which the symbol tables are to be returned. The options for program-specifier are described in REMARKS.
string-array-name
is the name of an existing, one-dimensional string array defined with at least 4 elements to receive the symbol table information. The information is placed in elements 0 through 4 as described in REMARKS. If string-array-name is defined with fewer than 5 elements, only those elements defined receive information. If string-array-name is not a one-dimensional string array, this directive re-dimensions it to be a one-dimensional array with 5 elements to receive the symbol table information.
line-ref
is the program line number to branch to if this directive produces an error.
error-code
is a programmer-defined error code. Valid values are positive or negative whole numbers.

This directive is generally available starting with release level 8.1.

The program from which the symbol tables are obtained is indicated by using one of the following values for program-specifier:

program-name
is a string of characters that names a program file.
CURRENT
is the keyword used to specify the currently executing program in memory.
MAIN
is the keyword used to specify the base program in memory.

If the CURRENT or MAIN parameter is used on a program that has been modified in memory (e.g., program lines deleted), the program symbol tables may not reflect all of these changes, because unused symbols are not removed from the symbol tables until the program is saved to disk.

If this directive is used in a program created in Thoroughbred Basic prior to level 8.0, an ERR=19 results.

The brackets in [ALL] are required and there must not be a space separating [ALL] from string-array-name.

The symbol table information is returned in the string-array-name elements as described in the following table:

Element
Description
0
Receives 3 bytes:

bytes 1 - 2 = number of symbol tables returned in unsigned binary

byte 3 = flag

$80$ = string-array-name does not have enough elements. Not all of the symbol tables were received.

$00$ = string-array-name has enough elements. All the symbol tables were received.

1
Receives the long variable name symbol table
2
Receives the statement label symbol table
3
Receives the long user-defined function name symbol table
4
Receives the format name table.
SYMTAB "PRINDX", PGM_SYMBOL$[ALL]

loads array PGM_SYMBOL$ with the symbol table information from program “PRINDX”.

SYMTAB CURRENT, PGM_SYMBOL$[ALL], ERR=7999

loads array PGM_SYMBOL$ with the symbol table information from the program currently in memory and branches to program line 7999 if the directive produces an error.

PFP, PFL functions, and FIXUP directive

From the Thoroughbred Basic Language Reference, Volume III: R–Z, version 8.9.1. Open this page in the PDF