HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

6- 21
Control Character Specifiers
A control character specifier specifies that one or more control
characters for carriage return, line feed, or form feed be printed or
suppressed. It consists of one symbol: #, +, -, @, or /.
Table 6-13 lists the control character specifiers, their positions in the
image
, (the item that is output) and their effect on the DISP USING or
PRINT USING statement.
Table 6-13. Control Character Specifiers
---------------------------------------------------------------------------------------------
|| | |
| Specifier | Position in Image | Effect on Output |
|| | |
---------------------------------------------------------------------------------------------
|| | |
| # | First
format_spec
| Suppresses carriage return and |
| | | line feed that would otherwise be |
| | | printed after display list values. |
|| | |
---------------------------------------------------------------------------------------------
|| | |
| + | First
format_spec
| Suppresses line feed that would |
| | | otherwise be printed after display |
| | | list values. |
|| | |
---------------------------------------------------------------------------------------------
|| | |
| - | First
format_spec
| Suppresses carriage return that |
| | | would otherwise be printed after |
| | | display list values. |
|| | |
---------------------------------------------------------------------------------------------
|| | |
|@ |Any
format_spec
. Can also replace | Prints formfeed. |
| | comma. | |
|| | |
---------------------------------------------------------------------------------------------
|| | |
|/ |Any
format_spec
. Can also replace | Formfeed followed by line feed. |
| | comma except that two @s must be | |
| | separated by a comma. | |
|| | |
---------------------------------------------------------------------------------------------
Examples
10 A$="ABC"
20 DISP USING "3A"; A$
30 DISP USING "K"; "xyz"
40 DISP USING "#,3A"; A$ !Suppress carriage return & line feed
50 DISP USING "K"; "xyz"
60 DISP USING "-,3A"; A$ !Suppress carriage return only
70 DISP USING "K"; "xyz"
99 END
The above program prints:
ABC
xyz
ABCxyz
ABC
xyz
The sequence:
100 DISP USING "+,3A"; A$
110 DISP USING "K"; "xyz"