HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
6- 9
then all output from the program and the HP Business BASIC/XL interpreter
is displayed on the standard list device. If HP Business BASIC/XL is
running interactively, the standard list device is the terminal. If HP
Business BASIC/XL is running in a job stream, the standard list device is
the line printer of the computer system HP Business BASIC/XL is running
on.
An output specification statement in any program unit affects the entire
program. If a program contains more than one SEND OUTPUT TO, SEND SYSTEM
OUTPUT TO, or COPY ALL OUTPUT TO statement, the most recently executed
one applies. It cancels any previously executed statement of its kind,
but not output specification statements of another kind. For example, a
SEND OUTPUT TO statement cancels any previously executed SEND OUTPUT TO
statements, but not SEND SYSTEM OUTPUT TO or COPY ALL OUTPUT TO
statements.
Spooled Output Devices. If an output device specification statement
specifies a spooled device, HP Business BASIC/XL opens a spool file. If
a subsequently executed output device specification statement specifies
the same spooled device, HP Business BASIC/XL closes the spool file that
it opened for the first statement and opens another one unless the
spooled device is PRINTER. See the next paragraph for information about
spooled device PRINTER. For example, if *LP is a file reference to a
spooled device, then when HP Business BASIC/XL executes the statement
SEND OUTPUT TO "*LP", it opens a spool file for PRINT statement output.
If HP Business BASIC/XL then executes the statement SEND SYSTEM OUTPUT TO
"*LP", it closes the spool file that it opened for PRINT statement output
and opens another spool file for system output.
If the standard list device is a spooled device, then HP Business
BASIC/XL opens a spool file when it executes the statement SEND SYSTEM
OUTPUT TO PRINTER or COPY ALL OUTPUT TO PRINTER. However, if HP Business
BASIC/XL then executes the statement SEND OUTPUT TO PRINTER, it does not
close the spool file and open another one. Therefore, it sends system
output and PRINT statement output to the same spool file.
Device Specification Syntax (dev_spec). Each output device specification
statement specifies an output device. The output device is called
dev_spec
(device specification) in the syntax specification for each
statement. If
dev_spec
is not a legal output device, an error occurs and
HP Business BASIC/XL substitutes the standard list device for
dev_spec
.
The syntax for
dev_spec
follows.
Syntax
[[,MARGIN
num_expr1
], FIELD
num_expr2
]
dest
[[,FIELD
num_expr2
], MARGIN
num_expr1
]
Parameters
dest
Destination device. See Table 6-8.
num_expr1
A numeric expression that evaluates to the number of
characters in an output line.
num_expr1
is rounded to
an integer,
n1
, which is called the margin. It is best
thought of as the number of characters to reach the
right margin. After an output statement prints
n1
characters on a line, it prints a carriage return and
line feed on that line. Remaining characters are
printed on the next line.
The margin cannot be less than the output field width,
num_expr2
. If
n1
is less than the field width, the
margin is set to the value of the field width. If the
output file is an ASCII disk file with fixed-length
records, the margin cannot exceed the record length.
For these files, if
n1
is greater than the record
length, the margin is set to the value of the record
length.
Default margin: See Table 6-9. Also, see the MARGIN