EasyManua.ls Logo

AMSTRAD CPC464 - The PRINT USING Format and ZONES; Print Tab

AMSTRAD CPC464
249 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
The <print list>, in the PRINT command refers to the list of items to be printed. This may be either
a number, variable or a string expression - which means a previously defined string variable (eg
HELLO$ ), or anything else contained within double quotes “”.
PRINT USING tidies up numbers into a fixed format for printing, so that columns can be aligned,
and unwanted remainders or fractional parts discarded.
3.6 The PRINT USING format and ZONES
At switch-on, BASIC sets the screen ZONE width into positions 13 columns wide. When the print
instruction includes a comma , the next item is tabbed forward to the next ZONE position. If there
are fewer columns available on a line than specified in the ZONE command, then BASIC will start
the next item to be printed on a new line. It does not break the item across the edge of a line.
With no USING format specified, BASIC prints positive numbers preceded by a space, negative
numbers preceded by a - sign. All numbers are followed by a space. The decimal point is omitted if
there is no significant fractional part of the item to be printed.
AMSTRAD BASIC does not support the [TAB] key as a column tab, since there is considerable lack
of unity on the meaning and function of this feature in various dialects of BASIC. Pressing the [TAB]
key prints a right arrow character *(the same as [CTRL] and the I key together), but otherwise has
no purpose in AMSTRAD BASIC.
3.7 PRINT TAB (<integer expression>) ( <print list> )
The effect of this is best illustrated by example. Enter this, and see the result:
5 MODE 2: INK 1,0: INK 0,9
10 FOR N=l TO 5
20 ZONE 40
30 PRINT TAB(N*4)“HI”,N
40 NEXT
This program illustrates both the ZONE together with the comma , and the TAB()functions at work.
Run it again with line 10 altered to:
10 FOR N=-5 to 5
The TAB instruction moves the start of the PRINT forward by the number of spaces specified in the
(integer expression>. (ZONE may be set in the range 1....255 - see the definitions in Chapter 8.)

Table of Contents

Other manuals for AMSTRAD CPC464

Related product manuals