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.
Syntax
Section titled “Syntax”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.
Remarks
Section titled “Remarks”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.
Examples
Section titled “Examples”Making the following entries in Thoroughbred Basic Console Mode:
100 INTEGER=NUMBER110 ?LST(PGM(100))RUNproduces the following output,
00100 LET INTEGER=NUMBERsince 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”.
See also
Section titled “See also”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