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

6- 17
Examples
DISP USING "DD.DD,2X,DDRDD"; 12.34, 12.34
The above statement prints:
12.34 12,34
Sign Symbols. The sign symbols, (S and M), specify the sign character.
A numeric specifier can have at most one sign symbol.
The sign symbols vary in that:
S Prints a plus (+) if the output value is positive, and a minus
(-) if it is negative.
M Prints a blank if the output value is positive, and a minus if it
is negative.
Examples
100 IMAGE SDD,2X,SDD
200 IMAGE MDD,2X,MDD
300 DISP USING 100; 10,-10
400 DISP USING 200; 10,-10
999 END
The above program prints:
+10 -10
10 -10
The sign can be printed between digits.
Examples
650 PRINT USING "2(DSD,2X,DMD,2X)"; -12,-34,56,78
The above statement prints:
1-2 3-4 5+6 7 8
Digit-Separator Symbols. The digit-separator symbols, (C and P), specify
the character that separates groups of digits as the commas do in
"1,000,000". The symbol C specifies a comma; the symbol P, a period.
Before printing a digit-separator symbol, the DISP USING or PRINT USING
statement prints at least one digit of the output value. That digit can
be a leading zero, if leading zeros are printed.
Examples
100 W=1234567
110 X=800342
120 Y=1234
130 Z=150
140 PRINT USING 300; W,W,W
150 PRINT USING 400; W,W,W
160 PRINT USING 300; X,X,X
170 PRINT USING 400; X,X,X
180 PRINT USING 300; Y,Y,Y
190 PRINT USING 400; Y,Y,Y
200 PRINT USING 300; Z,Z,Z
210 PRINT USING 400; Z,Z,Z
300 IMAGE 7Z,2X,ZC3ZC3Z,2X,ZP3ZP3Z
400 IMAGE 7D,2X,DC3DC3D,2X,DP3DP3D
500 PRINT USING "DCDDD.DD,2X,DCDDDPZZ"; 123456,123456
600 PRINT USING "DDCDDCDD"; 123456