Printing Text And Using The Control Codes - Epson 8133 User Manual

New apple ii intelligent parallel interface
Table of Contents

Advertisement

As well as demonstrating PRINT, the program shows how the CHAR
command is used. The third line prints the characters A and Busing
With APPLE LOGO the screen simply shows a flashing cursor:
everything you type will come out on the printer when you press the
RETURN key. You have to type without making mistakes or the result
will look confusing! LOGO's responses are also sent to the printer, so
that you have a complete printed record of the dialogue. Thus the
commands for enabling and disabling the printer behave in a similar
way to the PR # 1 and PR # 0 commands in BASIC; they just have
different names.
PRINTING TEXT AND USING THE CONTROL CODES
11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
Controlling the printer is similar to printing on the screen. You
have to be careful in giving commands to the printer, particularly with
the ESC/P sequences. The following program, used as an example to
list to the printer, was chosen not only to encompass the different print
commands, but also to illustrate the reason for using particular
command sequences.
APPLE LOGO
TO ENLARGE
.PRINTER 1
TYPE CHAR 27
TYPECHAR87
TYPE CHAR 1
PRINT !SOME ENLARGED TEXT]
.PRINTERO
END
MIT LOGO
TO ENLARGE
OUTDEV1
PRINT1 CHAR 27
PRINT1 CHAR 87
PRINT1 CHAR 1
PRINT [SOME ENLARGED TEXT]
OUTDEVO
END
If
the line:
(PRINT CHAR 27 CHAR 87 CHAR 1)
is used (which would be the same in both versions of LOGO) then the
printer will receive the ASCII code sequence 27, 32, ITT, 32, 1, instead
of 27, ITT,
l.
(Note the ASCII code for a space is 32.) This sequence is
meaningless as far as the printer is concerned, since <ESC> followed
by ASCII code 32 is not an instruction. This means that the next
character will be seen as a printable character, and a letter W will be
printed. It would also be possible in this case to use the alternative
method of using <ESC> W 1 where the actual character 1 is sent as part
of the sequence, instead of ASCII code
l.
The program would then be:
the CHAR command twice in one PRINT statement. The same characters
are then printed using the commands PRINT1 and TYPE - the
equivalent commands in the two versions of LOGO: these print text
without a carriage return. Note that if CHAR is used more than once in
a single statement, the characters are printed with a space in between
them.
If
they are printed separately, using TYPE or PRINT1, then the
characters are placed together just like printing them as a block of text.
This is important if the characters are control characters, so these
have to be printed using the CHAR function. The printer must see the
control characters as a complete string, without spaces. For example,
to select enlarged characters permanently, the sequence the printer
needs is <ESC> W then ASCII code 1: the ASCII code sequence is
27, ITT, l. The following program uses this sequence to print in
enlarged characters:
APPLE LOGO
TOPRT
.PRINTER 1
PRINT I.AN EXAMPLE OF TEXT!
(PRINT CHAR 65 CHAR 66)
TYPECHAR65
TYPECHAR66
PRINT[
l
PRINT [CD]
.PRINTERO
END
The output from the program be:
AN EXAMPLE OF TEXT
A B
AB
CD
MIT LOGO
TOPRT
OUTDEV 1
PRINT [AN EXAMPLE OF TEXT]
(PRINT CHAR 65 CHAR 66)
PRINT1 CHAR 65
PRlNT1 CHAR 66
PRINT!
l
PRINT [CD]
OUTDEVO
END
58
59

Advertisement

Table of Contents
loading

Table of Contents