AMSTRAD cpc 6128 User Instruction page 396

Integrated computer/disc system
Hide thumbs Also See for cpc 6128:
Table of Contents

Advertisement

The function S P C takes a numeric expression as a parameter, and will print as many
spaces as are specified by the expression. If the value is negative then zero is
assumed, if it is greater than the current stream (window) width, then the stream
width is assumed.
PRINT SPC(S)"hi"
hi
x=3
PRINT SPC(x*3)"hi"
hi
TAB is very similar except that it will print as many spaces as are needed so that the
item to be printed will appear in the specified column.
The stream in which all printed output will appear is window 0 unless a stream
director
(#)
is included before the list of items to be printed. Other streams may be
used to output to the other windows. Streams 8 and 9 are special cases - anything
printed on stream 8 will appear on the printer (if connected). Stream 9 directs output
to a disc (or cassette) file. Note however, that the W RI T E command should be used
instead of P R I N T for this purpose.
.
PRINT "hello"
hello
- window 0
PRINT #0,"hello"
he II
0
- also window 0
PRINT #4,"hello"
hello
- window 4
(At the top of the screen)
PRINT #8,"hello"
hello
- on the printer
(If connected)
TAB and S P C are fine for simple print formats, but to specify a more detailed format,
the PR I N T US I N G command, together with a suitable format template can be used.
A format template consists of a string expression containing special characters, each
of which will specify a particular type of format. These characters, called 'Format
field specifiers', are detailed in the description of the keyword PR I N T US I N G,
earlier in this manual. Some ofthe following examples however, may make their use
a little clearer.
Firstly, here are the formats available for the printing of strings:
At your leisure ....
Chapter 9 Page 23

Advertisement

Table of Contents
loading

Table of Contents

Save PDF