HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
2-: 28
>
GET SUB Statement
The GET SUB statement retrieves specified subunits from a BASIC SAVE
file and adds them to the current program. Current program lines are not
affected. If the current program executed the GET SUB statement,
execution continues at the line following the GET SUB statement.
The GET SUB statement retrieves subunits from BASIC SAVE files only. Use
the MERGE statement to retrieve subunits from ASCII and BASIC DATA
files.
Syntax
GET SUB
fname
[,
first_line
[,
increment
] ] [;
first_sub
[,
last_sub
] ]
Parameters
fname
BASIC SAVE file containing subunits to be retrieved.
first_line
A numeric literal that is the line number assigned to
the first retrieved line. If not specified, the default
value is the last line number + 1.
increment
A numeric literal that is the increment used for
renumbering the retrieved lines. If not specified, the
default value for the increment is 10.
first_sub
A numeric literal that is the number of the first
subunit to retrieve from the
fname
file. The first
subprogram or multi-line function in the
fname
file is
designated number 1. If no value is specified, the
value of
first_sub
is one. If the value of
first_sub
is
greater than the highest numbered subunit in the
fname
file, then an error occurs.
last_sub
A numeric literal that is the number of the last subunit
to retrieve from the
fname
file. If
last_sub
is greater
than the number of the last subunit in the
fname
file,
then all subunits from
first_sub
through the last
subunit in the
fname
file are retrieved. If no value is
specified, the value is the highest numbered subunit in
the
fname
file.
Examples
Consider a BASIC SAVE file named SUBFILE.
10 ! A file of subunits
20 SUB Subunit_1
30 SUBEND
40 SUB Subunit_2
50 SUBEND
60 SUB Subunit_3
70 SUBEND
80 SUB Subunit_4
90 SUBEND