Commodore 128 Programmer's Reference Manual page 67

Hide thumbs Also See for 128:
Table of Contents

Advertisement

R
' '
BASIC BUILDING BLOCKS AND BASIC 7.0 ENCYCLOPEDIA
57
f
f
PRINT#
p
Output data to files
'
PRINT# file number[, print list]
^
PRINT# is followed by a number which refers to the data file previously OPENed.
/ !
EXAMPLE:
10 OPEN 4,4
Outputs the data "HELLO THERE"
(j
20PRINT#4,"HELLOTHERE!",A$,B$ and the variables A$ and B$ to the
' '
printer.
10 OPEN 2,8,2
Outputs the data variables A, B$, C
i|
20 PRINT#2,A,B$,C,D
and D to the disk file number 2.
NOTE: The PRINT# command is used by itself to close the channel to
the printer before closing the file, as follows:
10 OPEN 4,4
30 PRINT#4, "PRINT WORDS"
40 PRINT#4
50 CLOSE 4
PRINT USING
Output using format
PRINT [#file number,] USING"format list"; print list
This statement defines the format of string and numeric items for printing to the text
screen, printer or other device.
EXAMPLE:
5 X = 32: Y = 100.23: A$ = "CAT"
10 PRINT USING "$##.### ";13.25,X,Y
20 PRINT USING "###>#";"CBM",A$
When this is RUN, line 10 prints:
$13.25 $32.00
$*****
Five asterisks (*****) are printed instead of a Y
value because Y has five digits, and this condition
does not conform to format list (as explained below).
Line 20 prints this:
CBM
CAT
Leaves two spaces before printing "CBM" as de
fined in format list.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents