HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
6-: 14
An error occurs if a numeric specifier corresponds to a string value or
if a string specifier corresponds to a numeric value. For example, the
statement
400 PRINT USING "DDZ.DD"; "GOOD-BYE!"
causes an error, since DDZ.DD is a numeric specifier and "GOOD-BYE!"is a
string.
Numeric Specifiers
A numeric specifier specifies the output format for a numeric value. It
can contain digit symbols, radix symbols, sign symbols, digit-separator
symbols, an exponent symbol, and repeat factors (numeric expressions).
Each symbol represents one printed character.
Syntax
fraction_part
[ ]
integer_part
[{E
fraction_part
}]
[{
fraction_part
E}]
Parameters
{{D} }
[S] {{Z} }
integer_part
[M][
n
]{{*} }
{{C} }
{K...}
{.} [S]
fraction_part
{R}[[
n
]D[D]...][M][n]D[D]...
n
Repeat factor; a numeric expression. The symbol that
follows it is repeated
n
times; for example, 5D is
equivalent to DDDDD.
See the sections "Digit Symbols" and "Digit-Separator Symbols" for
restrictions on combinations of the symbols D, Z, *, C, and P that the
above syntax specifiers do not reflect.
Table 6-12 summarizes the types of symbols that a numeric specifier can
contain, what each type specifies, and the individual symbols of each
type and their differences.
Table 6-12. Numeric Specifier Symbols
---------------------------------------------------------------------------------------------
|| | | |
| Symbol | Symbol Type | A symbol of this type | This symbol specifies that |
|| | specifies ||
|| | | |
---------------------------------------------------------------------------------------------
|| | | |
| D | Digit | One digit position. | Each leading zero is replaced |
| | | | with a blank. |
|| | | |
---------------------------------------------------------------------------------------------
|| | | |
| Z | Digit | One digit position. | Leading zeros are printed. |
|| | | |
---------------------------------------------------------------------------------------------
|| | | |
| * | Digit | One digit position. | Each leading zero is replaced |
| | | | with an asterisk (*). |
|| | | |
---------------------------------------------------------------------------------------------
|| | | |
| . | Radix | Position of radix; which | Radix is a period (.). |