Commodore VIC-20 User Manual page 376

Hide thumbs Also See for VIC-20:
Table of Contents

Advertisement

362
The VIC 20 User Guide
PRINT#
The PRINT External statement (PRINT#) outputs one or more data
items from the computer to an external device (cassette tape unit, disk unit,
or printer) identified by a logical file number.
Format:
PRINT#lf,data;CHR$(l3);data;CHR$(l3), ... ;CHR$ (l3);data
Data items listed in the PRINT# statement parameter list are written to
the external device identified by logical unit number
If.
Very specific punctuation rules must be observed when writing data to
external devices. A brief summary of punctuation rules is given below.
PRINT# Output
to
cassette Flies
Every numeric or string variable written to a cassette file must be
followed by a carriage return character. This carriage return character is
automatically output by a PRINT# statement that has a single data item in
its parameter list. But a PRINT# statement with more than one data item in
its parameter list must include c$ characters that force carriage returns. For
example, use CHR$(13) to force a carriage return, or a string variable that
has been equated to CHR$(13} such as c$=CHR$(13}.
PRINT# Output
to
Diskette Flies
The cassette output rules described above. apply also to diskette files
with one exception: Groups of string variables· can be separated by comma
characters (CHR$(44». The comma character separators, like the carriage
return separators, must be inserted using CHR$. String variables written to
diskette files with comma character separators must subsequently be read
back by a single INPUT# statement. The INPUT# statement reads all text
from one carriage return character to the next.
PRINT# Output
to
the Une PrInter
When the PRINT# statement outputs data to a line printer CHR$ must
equal CHR$(29}. No punctuation characters should separate CHR$ from
data items, as illustrated in the PRINT# format definition.
Caution: The form ?# cannot be used as an abbreviation for PRINT#.

Advertisement

Table of Contents
loading

Table of Contents