Abbreviation: P <SHIFT+R>
TYPE: I/O Statement
Actions: The PRINT# statement is used to write data items to
a logical file. It must use the same number used to OPEN the file.
Output goes to the device-number used in the OPEN statement. The
<variable> expressions in the output-list can be of any
type. The punctuation characters between items are the same as
with the PRINT statement and they can be used in the same ways.
The effects of punctuation are different in two significant respects.
When PRINT# is used with tape files, the comma, instead of spacing
by print zones, has the same effect as a semicolon. Therefore,
whether blanks, commas, semicolons or no punctuation characters
are used between data items, the effect on spacing is the same.
The data items are written as a continuous stream of characters.
Numeric items are followed by a space and, if positive, are preceded
by a space.
If no punctuation finishes the list, a carriage-return and a
line-feed are written at the end of the data. If a comma or semicolon
terminates the output-list, the carriage-return and line-feed
are suppressed. Re-gardless of the punctuation, the next PRINT#
statement begins output in the next available character position.
The line-feed will act as a stop when using the INPUT# statement,
leaving an empty variable when the next INPUT# is executed. The
line-feed can be suppressed or compensated for as shown in the
The easiest way to write more than one variable to a file on
tape or disk is to set a string variable to CHR$(13), and use
that string in between all the other variables when writing the
EXAMPLES of PRINT# Statement:
||10 OPEN 1,1,1,"TAPE FILE"
50 PRINT# 1,7
(By Changing the CHR$(13) to CHR$(44) you put a ","
between each variable. CHR$(59) would put a ";"
between each variable.)
AAA,BBB CCCDDDEEE (carriage return) FFF(carriage return)
(10 blanks) AAA BBB