HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
6-: 8
If a program contains more than one numeric format statement, the most
recently executed statement applies, with one exception: numeric format
statements in a subunit are canceled when control returns to the calling
program unit.
Examples
10 FIXED 2 !Fixed-point format goes into effect
15 INPUT X
16 PRINT X !Print X in fixed-point format
20 CALL Sub1(X) !Call Sub1; format is fixed-point
30 PRINT X !Print X in floating-point format
99 END
100 SUB Sub1(N)
105 PRINT N !Print N in fixed-point format
110 STANDARD !Standard format goes into effect
115 PRINT N !Print N in standard format
116 CALL Sub2(N) !Call Sub2; format is standard
117 PRINT N !Print N in standard format
120 SUBEND !Return to line 30 and floating-point format
200 SUB Sub2(P)
210 PRINT P !Print P in standard format
220 FLOAT 4 !Floating-point format goes into effect
230 PRINT P !Print P in floating-point format
240 SUBEND !Return to line 117 and floating-point format
If 125.7689 is entered for x in line 5, the above program prints:
?125.7689
125.77
125.77
125.7689
125.7689
1.2577 E+02
1.2577 E+02
1.2577 E+02
Output Device Specification
The SEND OUTPUT TO, SEND SYSTEM OUTPUT TO, and COPY ALL OUTPUT TO are
output specification statements. Table 6-7 indicates what they specify.
Table 6-7. Device Specification Statements
---------------------------------------------------------------------------------------------
| | |
| Device Specification Statement | Specifies |
| | |
---------------------------------------------------------------------------------------------
| | |
| SEND OUTPUT TO | Device for PRINT statement output. |
| | |
---------------------------------------------------------------------------------------------
| | |
| SEND SYSTEM OUTPUT TO | System printer. |
| | |
---------------------------------------------------------------------------------------------
| | |
| COPY ALL OUTPUT TO | Device for interpreter and program output. |
| | |
---------------------------------------------------------------------------------------------
Each of these statements is defined in chapter 4.
If an output specification statement specifies a spooled output device,
HP Business BASIC/XL opens a spool file. If a subsequently executed
output 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 spool file. Unless the first spool file is
the standard list device, it is ready for printing when HP Business
BASIC/XL closes it. See "Spooled Output Devices" for more information.
If a program does not contain output device specification statements,