HP RPG/iX Utilities Reference Manual (30318-90006)
2- 184
L *-5/*+5 List a range of lines beginning five lines before the current position of the record pointer and
ending five lines after the record pointer.
L10 List line 10.
L List the line following the position of the current record pointer. (Used for stepping through
a file, line by line.)
In the first example, TEXT is used to copy SIMCAL into a work file, and the first five lines are listed on the
screen using the LIST command (1). The LIST command is then used with the asterisk--(*)--which
symbolizes the current position of the record pointer. The command calls for a range of ten lines beginning
five lines before the current record pointer position. Since the previous command left the record pointer at
line 5, when the command is executed, lines 1 through 10 are displayed (2).
When the L[IST] command is used without any parameters, the line following the current position of the
record pointer is listed. Thus, lines 11 through 13 are stepped through (3).
(1) >T SIMCAL
Text completed.
>L 1/5
1 00011H
SIMCAL
2 00012FINPUT IP F 72 DISK
3 00013FOUTPUT O F 72 DISK
4 00014IINPUT AA 01 1 CA
5 00015I OR 02 1 CS
(2) >L*-5/*+5
1 00011H
SIMCAL
2 00012FINPUT 1P F 72 DISK
3 00013FOUTPUT O F 72 DISK
4 00014IINPUT AA 01 1 CA
5 00015I OR 02 1 CS
6 00016I OR 03 1 CM
7 00017I OR 04 1 CD
8 000181 OR 05
9 00019I 8 72OPRND1
10 00020I 9 132OPRND2 99
(3) >L
11 00021C 01 OPRND1 SUB OPRND2 RESULT 104
>L
12 00022C 02 OPRND1 SUB OPRND2 RESULT
>L
13 00023C 03 OPRND1 MULT OPRND2 RESULT
In the second example, LIST is used to bring the last line of the file to the screen (1). Next, the special
character "@", which has the same meaning to RISE as the asterisk (*), is used with LIST to display the
five lines preceding the current position of the record pointer--at line 38 after the last command. Thus, the
last five lines of the file are listed (2).
(1) >L LAST
38 00048O*END OF PROGRAM
(2) >L @-5/L
33 00043O D 11 1P
34 00044O OR N1P
35 00045O 13 "C NNNDD NNNDD"
36 00046O D 05
37 00047O 15 "INVALID REQUEST"
38 00048O*END OF PROGRAM