Star Micronics Rainbow NX-1000C User Manual page 38

Table of Contents

Advertisement

If you connect two printers to your computer, set their DIP switches
so that one has device number 4 and the other has device number 5.
sa
The secondary address. If this parameter is omitted, the secondary
address is assumed to be O. The secondary address controls the printer's
default character set in the Commodore operating mode: 0 selects the
graphics character set; 7 selects the business character set.
PRINT#ifn[,data ] [;]
/fn
The logical file number assigned in the OPEN statement.
data Numbers, character strings, or variables to be printed. If there are
no data, a blank line is printed.
;
If you want to continue printing on the same line, place a semicolon
at the end of the data. If there is no final semicolon, after printing the
data the printer feeds to the beginning of the next line.
No space is permitted between the word PRINT and the
#
sign. Spaces
after the # sign are ignored.
CLOSE
ifn
/fn
The same logical file number as in the OPEN statement.
The CLOSE statement terminates the connection between the logical
file number and device number in the OPEN statement, freeing the logical
file number so it can be assigned to another device.
Commodore BASIC allows a maximum of ten files to be open at once,
so it is good practice to close a file as soon as you have finished using it.
Shown below is a sample program using the OPEN, PRINT#, and
CLOSE statements. Line 10 opens the printer with logical file number 4,
the same as the device number. The secondary address parameter is omitted,
so the graphics character set will be printed. Lines 20, 40, and 60 print
character strings. Line 30 prints a blank line. Line 50 prints numeric data.
Line 40 ends in a semicolon, so the data in lines 40 and 50 are printed on
the same line.
10 OPEN4,4
20 PRINT:II:4. "PRINT SAMPLE"
30 PRINT:II:4
40 PRINT:II:4, "THE SQUARE ROOT OF 1000 IS";
50 PRINT:II:4, SQR(1000)
60 PRINT:II:4, "'BYE"
70 CLOSE4
80 END
28
r
r:
r
r
r
r
r
f
I
I
L
I
I
I
I
l
l
l
L
~
L

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents