HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
6-: 18
999 END
The above program prints:
1234567 1,234,567 1.234.567
1234567 1,234,567 1.234.567
0800342 0,800,342 0.800.342
800342 800,342 800.342
0001234 0,001,234 0.001.234
1234 1,234 1.234
0000150 0,000,150 0.000.150
150 150 150
1,234.56 1,234.56
12,34,56
Exponent Symbol. The exponent symbol, E, specifies scientific notation.
A numeric specifier must have at least one digit symbol before the symbol
E. The DISP USING or PRINT USING statement prints the output value in the
format
{+} {+}
{-}
digit
[
digit
...][.
digit
[
digit
...]]E{-}
digit digit
The exponent symbol can precede or follow the fractional part of the
numeric specifier. The numeric specifier must contain a sign symbol if
the output value is negative.
Examples
100 N=123.45
110 DISP USING "D.DDDE"; N !1.235E+02 (rounded)
120 DISP USING "DDDDD.E"; N !12345.E-02
130 DISP USING "3D.2DE"; -N !Overflow error
140 DISP USING "S3D.2DE"; -N !-123.45E+00
999 END
String Specifiers
A string specifier specifies the output format for a string value. The
specifier can be nonliteral or literal. A nonliteral string specifier
contains the symbol A, which can be preceded by a repeat factor (numeric
expression). A literal string specifier is a quoted literal.
Syntax
Nonliteral string specifier:
[
num_expr
]A
Literal string specifier:
str_lit
Parameters
num_expr
Repeat factor. Its value is the length of the output
string. If this is not specified, the default is one.
str_lit
Literal string specifier. It must be enclosed in quotes
and it can only appear in an IMAGE statement (not in a
format string). It does not correspond to an item in
the display list; the DISP USING or PRINT USING
statement prints
str_lit
itself.
A nonliteral string specifier specifies the output format for a string
value in the display list. It can appear in either an IMAGE statement or
a format string.