HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
4- 54
Floating-point format is appropriate for very large and very small
numbers. Floating-point format is
{+}
[-]
d
[[
d
]...]E {-}
dd
[
d
]
where
d
is a numeric digit. The leftmost minus sign prints if the number
is negative. The decimal point prints unless
n
is zero, and it is
followed by
n
digits. To express the number in fixed-point format, raise
ten to the power of the exponent (represented by {+|-}
dd
[
d
]) and multiply
it by the mantissa (represented by [-]
d
[.
d
[
d
]...]).
Examples
10 FLOAT 2
20 PRINT 123;.4567;-79810;-1.235E+47
99 END
The above program prints:
1.23E+02 4.57E-01 -7.98E+04 -1.24E+47
If line 10 is changed to
10 FLOAT 3
then the program prints:
1.230E+02 4.567E-01 -7.981E+04 -1.235E+47
FLUSH INPUT
The FLUSH INPUT statement empties the input buffer. The input buffer is
a buffer where all the data that you have typed in is stored. If an
INPUT statement reads three variables, and you have typed in six, the
last three remain in the input buffer. If there is data remaining in the
input buffer and another INPUT statement is issued, the INPUT statement
will pick up that remaining data. The FLUSH INPUT clears that buffer, so
that the next INPUT statement will not use that data.
Syntax
FLUSH INPUT
Examples
100 INPUT A,B,C: !Extra input for this statement, e.g., 1,2,3,4,5,6
110 INPUT :D,E,F !is used by this statement, i.e., D = 4, E = 5, F = 6
120 !but
200 INPUT A,B,C: !extra input for this statement
210 FLUSH INPUT !is flushed from the buffer
220 INPUT :D,E,F !and not used by this statement.
999 END
FNEND
The FNEND statement defines the end of a multi-line function. A
multi-line function returns both control of the execution and a value via
a RETURN statement. The FNEND statement serves as a marker for the last
statement in the function. Therefore, an error occurs if the FNEND
statement actually executes.
Syntax
{FNEND }
{FN END}
The FNEND statement is legal only in a multi-line function. It is
illegal in the main program or a subprogram.
It is good programming practice to end a multi-line function with an
FNEND statement and use RETURN statements within the function. However,
an FNEND statement can appear more than once in a multi-line function at
either the beginning of the next subunit or at the end of the containing
program. The start of the next subunit in a program does indicate the