PFL
Prepare for Listing
This string function is used only by utility programs, which read and list other programs as program files. It is meant to prepare for listing a compiled Thoroughbred Basic line of program code.
Syntax
Section titled “Syntax”PFL (string-value, symbol-table)string-value- is the compiled form of a single Thoroughbred Basic statement.
symbol-table- is the actual symbol table portion of a Thoroughbred Basic program.
Remarks
Section titled “Remarks”This function is generally available starting with release level 8.0.
Although Thoroughbred Basic is an interpretive language, actual program statements are kept in memory and on storage media in a pseudo-compiled state. This allows Thoroughbred Basic to maintain programs in less space in memory and on storage media and to execute individual statements more quickly than if all statements were maintained in their fully expanded, LISTed form.
This function is not normally used within business applications, but is commonly found within system utilities, which manipulate program files. As such, it should not be used indiscriminately.
The PFL function is necessary only when processing Thoroughbred Basic program statements that have not been LOADed into memory. Programs that are LOADed into memory need only the LST function to convert them into readable, interpretive format.
In storage media format, each program line that refers to a named variable contains an index number into the symbol table for that name. The symbol table is maintained at the end of the program lines. Its position is obtained by the first few bytes in the actual program file that contains the program. Starting with the first byte in the program file as byte 1, the start of the symbol table is at the DEC (decimal) function of byte 5 for 4 bytes plus the constant, 12. Assuming that the program file was contained in the string variable PROGRAM_FILE$, then the symbol table for that program file starts at DEC(PROGRAM_FILE$(5,4))+12.
Examples
Section titled “Examples”LET LISTED_LINE$ = LST(PFL(OBJECT_CODE$, SYMBOL_TABLE$))places, in LISTED_LINE$, the LISTed form of the program line contained in OBJECT_CODE$ after resolving all variable names based on the symbol table in SYMBOL_TABLE$.
LET LISTED_LINE$ = LST(PGM(00100))places, in LISTED_LINE$, the LISTed form of program line number 00100 of the program LOADed into memory. Since this program is LOADed into memory and its symbol table already resolved, the PFL function is not needed.
See also
Section titled “See also”CPL, LST, PFP, and PGM functions
From the Thoroughbred Basic Language Reference, Volume II: F–Q, version 8.9.1. Open this page in the PDF