L
Lists source code line(s) from the currently executing DataBasic program.
Syntax
L{lineNumber}
Lstart-end
Lstart,count
L*
W{lineNumber}
Operation
-
To list the source code line about to be executed, enter
L
. -
To list a specific source code line, enter
L
lineNumber, where lineNumber is the number of the line. -
To list a range of source code lines, enter
L
start-end, where start is the starting line number and end is the ending line number. -
To list a specified number of lines beginning with a particular line, enter
L
start,
count, where start is the starting line number and count is the number of lines. -
To list all program lines, enter
L*
. -
To list a page of source code up to and including the line about to be executed, enter
W
. -
To list a page of source code up to and including line lineNumber, enter
W
lineNumber.
Included Code
If there are no INCLUDE or $CHAIN statements in the listed source, only one line number is displayed. Otherwise, the program line number is given, followed in brackets by details of how this is derived. For example, 9 [4+3+2]
shows program line 9, which is made up of source line 4, first include line 3, second (nested) include line 2. See the example below.
Specifying Line Numbers
-
Enclosing a line number in brackets specifies that this is a source line number; that is, a line number in the source code. With no brackets, the line number refers to the combination of the source item with any included or chained items. In the example below, entering
L6
lists line 6 of the program, which is in fact line 2 of the first included item:
6 [4+2] INCTEST.2 = 4
However, entering
L[6]
lists source line 6; that is:
15 [6] SRC6 = BILL
-
Line numbers can be entered as combinations of source item lines and included lines. For example, entering
L[4+2]
lists program line 6 as above, and
L[4+3+2]
lists line 2 of the item included at line 3 of the item that was itself included at line 4 of the source item; that is program line 9:
9 [4+3+2] INCTEST2.2 = 8
-
If the line number from the included item is placed outside the brackets, nested includes are treated as if they were a single item. For example, entering
L[4]+5
lists program line 9:
9 [4+3+2] INCTEST2.2 = 8
whereas entering
L[4+5]
lists program line 14 (the fifth line of the item included at source line 4):
14 [4+5] * End of INCTEST - 4
-
These formats can be used for both the start and end line numbers in a range. For example,
L[4]+5-[4+5]
lists program lines 9 to 13:
9 [4+3+2] INCTEST2.2 = 8
10 [4+3+3] INCTEST2.3 = 10
11 [4+3+4] * End of INCTEST2 - 4
12 [4+4] INCTEST.3 = 5
13 [4+5] * End of INCTEST - 4
Next Line
The next line to be executed is marked with a chevron (>); see example below.
Example
:DEBUG TEST INCL D INCL 1 *L* 1 [1] > * Start of SRC - 1 2 [2] SRC2 = 2 3 [3] SRC3 = 3 4 [4] INCLUDE INCTEST 5 [4+1] * Start of INCTEST - 1 6 [4+2] INCTEST.2 = 4 7 [4+3] INCLUDE INCTEST2 8 [4+3+1] * Start of INCTEST2 - 1 9 [4+3+2] INCTEST2.2 = 8 10 [4+3+3] INCTEST2.3 = 10 11 [4+3+4] * End of INCTEST2 - 4 12 [4+4] INCTEST.3 = 5 13 [4+5] * End of INCTEST - 4 14 [5] SRC5 = 5 15 [6] SRC6 = BILL 16 [7] SRC7 = 7 17 [8] * END OF SRC - 8 18 [9] End of source code. *
This example uses the L*
command to list the program INCL from the file TEST. Line 4 of this program includes the item INCTEST, which itself includes the item INCTEST2 at line 3 (the included lines are shown highlighted above).
The next line to be executed is line 1 (marked with a chevron).
The line numbers in brackets in lines 5 to 13 of the listing show that the lines have been included. For example, line 5 is given as [4+1]; that is, line 1 of the item included at line 4 of the source item. Similarly, line 9 is given as [4+3+2]; that is, line 2 of the item included at line 3 of the item that was itself included at line 4 of the source item.