If a number to be printed is larger than the specified numeric field, a percent sign (%) is printed in front of the number. If rounding causes the number to exceed the field, the percent sign is printed in front of the rounded number. See lines 20 and 21 in the example given below.
The **, $$, and **$ are mutually exclusive; i.e., they may not appear together in a single format description.
a$ = "SANTA": b$ = "CLAUS" 1 print using "!"; a$; b$ 2 print using "\\"; a$; b$ 3 print using "\ \"; a$; b$ 4 print using "!"; a$; 5 print using "&"; b$ 6 print using "##.##"; .69 7 print using "###.##"; 562.206 8 print using "##.## "; 15.4, 4.1, 84.035, .381 9 print using "+##.## "; -52.69, 1.4, 26.6, -.7 10 print using "##.##- "; -52.69, 23.361, -3.02 11 print using "**#.# "; 35.04, -0.7, 953.2 12 print using "$$###.##"; 132.05 13 print using "**$##.##"; 6.09 14 print using "####,.##"; 2405.39 15 print using "####.##,"; 2405.39 16 print using "##.##^^^^"; 815.03 17 print using ".###^^^^-"; -66666 18 print using "+.##^^^^"; 512 19 print using "_!##.##_!"; 32.87 20 print using "##.##"; 653.98 21 print using ".##"; .999This produces the output
SC SACL SA CL SCLAUS 0.69 562.21 15.40 4.10 84.03 0.38 -52.69 +1.40 +26.60 -0.70 52.69- 23.36 3.02- *35.0 *-0.7 953.2 $132.05 ***$6.09 2,405.39 %2,405.390 8.15E+02 .667E+05- +.51E+03 !32.87! %653.98 %1.00
If an item in ExprList does not have a type appropriate for its field in StrExpr, a "Type mismatch" error occurs.
from The Basmark QuickBASIC Programmer’s Manual by Lawrence Leinweber