FORMAT
Format: FORMAT N
Supported by: COMX BASIC V1.00, Pecom 32 BASIC, Pecom 64 BASIC 1.0 and 4.0, Quest Super BASIC 6.0, RCA BASIC3 V1.1, Telmac SBASIC v 24.3
Similar commands: -
This statement specifies the field size (i.e. the number of places of printed numeric data. Any PRINT statement coming after the FORMAT statement, whether printing the value of a variable, or printing a number, will have the field size specified. For example
10 A = 123456 20 FORMAT 6 30 PR A 40 PR 678901 RUN
will give
123456
678901
If line 20 is replaced by.
20 FORMAT 5
the result is.
*****
*****
If line 40 is replaced by
40 PR -67890
the result is.
*****
-****
Summing up, if the field size of a positive number is greater than N, N asterisks will be printed. If the number is negative, a negative sign followed by (N-1) asterisks will be printed.
The range of n is from 1 to 15.
FORMAT 0 means that the constraint due to FORMAT is turned-off. For example.
10 FORMAT 5 20 PR 123456 30 FORMAT 0 40 PR 123456 RUN
will give
*****
123456