Skip to content

PGM

Return Thoroughbred Basic Statement in Compiled Format

This string function returns the pseudo-compiled form of the specified Thoroughbred Basic statement in the current program.

PGM (numeric-value [,MAIN])
numeric-value
is any integer representing a valid program line in the program currently LOADed into memory (a statement label is not valid).
MAIN
directs a public program to return the program line from the main program, which was RUN rather than the public program that contains the PGM directive.

If the program line specified by numeric-value does not exist, the next higher numbered program line is returned.

If the program line specified by numeric-value is past the last program line number, “END”, with no line number, is returned.

Making the following entries in Thoroughbred Basic Console Mode:

100 INTEGER=NUMBER
110 ?LST(PGM(100))
RUN

produces the following output,

00100 LET INTEGER=NUMBER

since the PRINT at 110 (? is shorthand for PRINT) shows the listed form of program line number 00100.

PGM (X)

If X=100 has the same effect as the first example.

Y$=PGM (X)

If X=100, assigns Y$ the value produced by the examples above.

PRINT LST (PGM(400))

If 400 is larger than the last statement number in the program, returns “END”.

CPL, LST, PFL, and PFP functions
LIST directive

From the Thoroughbred Basic Language Reference, Volume II: F–Q, version 8.9.1. Open this page in the PDF