How to output format characters on a PRINT USING statement

If a format string has non-format characters, they are outputted not replaced, but format characters cannot be outputted not replaced.
The format characters are following 11 characters.
# $ % * + , - . < > ^

If you want to output them in a PRINT USING statement, let the position in the format string where them should be outputted be a format item to replace it by them.
For example, If you wish to output "+", you can do it by as follows.

10 FOR a=1 TO 10
20    FOR b=1 TO 10
30       PRINT USING "## # ## = ###": a , "+" , b , a+b
40    NEXT b
50 NEXT a
60 END



Interpretation of a format string is prescribed at 10.4 Formatted Output in the ANSI Full BASIC or ECMA-116 BASIC.
see also PRINT USING Procedures in True BASIC.
When you consult them, you will get some important informations.
For example, you will know that format items can be made without punctuated by literals whereas the above does not so. For example, the following program outputs letters packed.

30       PRINT USING "##%##=###": a , "+" , b , a+b



In addition, if the objects to be formatted are only numeric values, you can do only using USING$ functions as follows.

30       PRINT USING$("##",a); "+"; USING$("##",b); "="; USING$("###",a+b)


Back