Skip to content

LIST

List Program Statements

This directive outputs program statements from the copy currently in memory to a terminal or file OPEN on the channel specified.

LIST [(channel [,ERR=line-ref|,ERC=error-code] [, IND=index-num]
[, TBL=line-ref])] [line-ref1] [, line-ref2]
channel
is an integer in the range of 0 to 32764 indicating the channel of an OPEN file or device. If omitted, 0 is the default.
line-ref
for ERR=, is the program line number or label to branch to if an error is produced by this directive. For TBL=, line-ref is the integer number of the TABLE directive to be used to convert each character before LISTing to the terminal or file.
error-code
is a programmer-defined error code. Valid values are positive or negative whole numbers.
index-num
is an integer in the range of 0 to 8388607 specifying the index number of the first record in the file OPEN on the channel to receive this LISTing.
line-ref1
is a statement label or line number designating the first program line to be LISTed from the program; the default is 00001.
line-ref2
is a statement label or line number designating the last line to be LISTed from the program. This cannot reference a line below line-ref1. If not specified and the comma is used, defaults to 65534; if not specified and no comma is used, defaults to line-ref1.

The upper default is limited to the highest program line number allowed. The upper limit is generally 9999 in release levels before 7.0 and 65534 in release levels beginning with 7.0.

LIST output can be directed to an INDEXED file, whose record size is at least 80, for later use. The MERGE directive is used to bring program code back into memory.

Beginning with release level 8.1B2, the LIST directive automatically paginates a listing to the terminal screen by pausing and displaying a prompt at the bottom of the screen. Press Enter or the space bar to list the next screen, Escape to go to Thoroughbred Basic Console Mode, or Ctrl-L to cancel pagination and continue with the listing. This feature is generally available starting with release level 8.1.

LIST

lists all program statements to the terminal and has the same results as each of the following:

LIST 1, 65534
LIST 1,
LIST ,65534
LIST 123

lists statement 123 if this statement exists; lists nothing if it is not present.

LIST 123,

lists statements starting with 123 or the next higher numbered statement up through 65534.

LIST ,123

lists statements 1 through 123.

LIST 123,350

lists statements from 123 through 350.

LIST (4) 123,350

has the same effect as above, but lists the output to the file OPEN on channel 4.

LIST (4, ERR=7999, TBL=5500) 123,350

has the same effect as above but transfers program execution to statement 7999 if an error occurs while processing this directive and uses the TABLE directive at line 5500 for code conversion.

LIST (4, IND=20)

lists the program currently in memory to the file OPEN on channel 4, starting at record number 20 of the file (IND is zero-based).

MERGE directive

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