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 M O D E 2 : I N K 1 , 0 : I N K 0 , 9
10 FOR N=l TO 5
20 ZONE 40
3 0 P R I N T T A B ( N * 4 ) “ H I ” , 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.)
Содержание CPC464
Страница 1: ......
Страница 32: ...or you can type 3e1 1e1 ENTER 300 2 3000x1000 Type 3e3 1e3 ENTER 3000000 3 3000x0 001 Type 3e3 1e 3 ENTER 3 ...
Страница 102: ...PRINT 10 AND 12 Results in 8 PRINT 10 AND 1000 Results in 8 again ...
Страница 118: ...TO DO DRAW THIS PAGE ...
Страница 219: ...actual value may be made to vary during the execution of a program ...
Страница 240: ...Text and WINDOW planner Mode 2 80 Columns ...
Страница 241: ......
Страница 245: ...Sound envelope Music planner sheet ...