HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
2-: 53
overhead associated with them becomes noticeable. The Replace GOSUBs
screen can, with certain restrictions, be used to replace a GOSUB with
the body of the referenced subroutine. This is possible when there are
enough available line numbers after the GOSUB to insert the entire
subroutine before the next line, and the subroutine does not contain and
GOTO statements or any lines that are targets of branches.
The Replace GOSUBs screen prompts you for a line range to use to search
for eligible GOSUBs. It also asks for the maximum number of lines to be
inserted for each GOSUB. The Program Analyst then creates an ASCII file
containing a copy of the referenced subroutine. If you choose to replace
the GOSUB with the subroutine, the GOSUB statement is deleted and the
copy of the subroutine is inserted in its place. If the subroutine
contains consecutive assignment statements, the Program Analyst combines
them into fewer lines if possible.
The existence of this screen should not suggest that all GOSUBs should be
eliminated. Only those that are used very frequently should be
considered for replacement.
The Replace GOSUBs screen is useful in conjunction with the Extract
Subunit screen described later. Replace GOSUBs can help to resolve
subroutine references that might otherwise prevent a successful
extraction.
The Optimize PACKFMTs Screen. The purpose of this screen is to generate
SKIP clauses for PACKFMT statement to minimize packing and unpacking of
variables.
Often a subunit needs to access only a few items specified in a PACKFMT
statement. In a PACK or UNPACK statement, the entire record will be
transferred between the string buffer and the variable, even if the
PACKFMT statement has information for many more items than the subunit
is using.
To improve efficiency, the PACKFMT specification can contain one or more
SKIP clauses. A SKIP specifies that a certain number of bytes in the
string buffer are to be ignored during an UNPACK and skipped over during
a PACK.
The Optimize PACKFMTs screen determines which items can be skipped,
calculates the number of bytes to skip, and then modifies a PACKFMT
accordingly.
When you enter this screen, you are prompted for the line number of a
PACKFMT statement. You can enter a line number or use a softkey to list
the line numbers of all of the PACKFMT statements in your program. If
the correct line number of a PACKFMT is entered, each item in the PACKFMT
statement is examined. If the PACKFMT statement is used anywhere else in
the subunit, or if it is in common or is a parameter to the subunit, the
Program Analyst assumes that it is needed and cannot be skipped.
Otherwise, the Program Analyst determines the number of bytes in that