English
Language : 

NSB8 Datasheet, PDF (97/158 Pages) List of Unclassifed Manufacturers – BASIC interpreter for Z80 family
ITALIAN TECHNOLOGY
grifo®
format specification consists of the percent sign (%), a number, and the capital letter “I”, as in the
following:
%3I
The number given specifies the number of column positions on the printed line which will be reserved
to hold the number. The %3I format specification, for example, requires that any number printed
according to it must be an integer, and must fit in three character positions. Therefore, 0, positive
numbers from 1 to 999, and negative numbers from -1 to -99 may be printed under this
format. Remember that the negative sign counts as taking a character position.
When printing a programmer formatted number, BASIC does not automatically insert leading spaces
to keep the number from bumping up against previously printed information on the same line, as it
does in free format. The statement:
PRINT “OOPS” , %3I,349
results in
OOPS349
on the terminal. In order to separate your formatted output from other output, you may elect to PRINT
explicit spaces before (and after) the number, use the TAB function, or specify a field width large
enough to provide at least one blank space between the number and previous information on the line.
RIGHT JUSTIFICATION
All programmer formatted numbers are automatically right justified within their PRINT fields. That
is, the number is printed so that, in a field which is n character positions wide, the last character in
the printed number occurs in the nth (rightmost) character position of the field, and spaces fill to the
left. The following numbers are right justified:
349
1234
7.3
8.42
-2118.37
1.61
Note that, when right justified numbers having the same number of digits after the decimal point are
printed one above the other, the decimal points will line up. Note that decimal point numbers cannot
be printed using I format, but are included in this example because BASIC’s decimal point format,
to be discussed soon, also right justifies.
The statement
PRINT “HERE IS A GAP: ” , %10I,2
produces the output
NSB8
Rel. 5.10
Page 85