Apple Writer III: Sending printer codes

Apple Writer III: Sending printer codes

Many printers have special features that the computer signals by sending
command codes. To send codes to a printer from an Apple III with Apple Writer,
you must insert the codes into the Apple Writer file you want printed. The
manual of the printer may list the codes by several names: decimal,
hexadecimal, teletype abbreviations (SOH, ETX, DC1, DC3, etc.), standard keys,
and combinations of the above.
 
Using the chart "ASCII characters, values, and keystrokes", you have to
translate from the name of the code in the printer manual into the name of the
corresponding keystroke or keystrokes on the keyboard of the Apple III.
 
Some keystrokes put so-called control characters into the Apple Writer file.
These control characters are not part of the conventional English character
set; while screen shows them, the printer intercepts and does not print them,
instead recognizing them as signals to turn special functions on and off or to
change printer settings.
 
With these considerations in mind, here is a list of codes and methods for
inserting them in an Apple Writer file on an Apple III.
 
NOTE: In the descriptions of the keystrokes, the characters greater than and
      less than, < and >, are used to contain one keystroke, which can mean
      that:
      1. You must simultaneously hold down the control key, the shift key, or
         both as you press the other key, or
      2. You must press a special key, such as ESC or RETURN.
 
Null (ASCII value 0):
 
    Because Apple Writer III uses the null character to mark the end of a file,
Apple Writer does not allow a null to be inserted into the file. The inserted
null would effectively delete any text after it.
 
    Apple Writer does send a null in the place of a Control-Underline
      character:
 
    <CTRL-V><CTRL-UNDERLINE><CTRL-V>
 
Control-A through Control-Z (ASCII decimal values 01 through 26):
 
    Example: Control-Z (ASCII decimal value 26): <CTRL-V><CTRL-Z><CTRL-V>
 
    Exception: Control-V (ASCII decimal value 22) can't be entered.
               See "Missing Characters" below.
 
Escape (ASCII value 27): <CTRL-V><ESC><CTRL-V>
 
Other Control characters: These can be entered in the manner of Control-A
through Control-Z.
 
Missing Characters:
 
You can't directly enter a Control-V in Apple Writer. To use this character in
Apple Writer, it is necessary to use an Apple Writer glossary file. You will
find such a file on the Apple Writer III master diskette.
 
Apple Writer doesn't send a Control-Underline as such.
 
Business BASIC can be used to send a Control-Underline to your printer.
 
1. Create your Apple Writer document as usual, but substitute a unique
   character in each place that you want a Control-Underline character.
 
2. Type <CTRL-P> to display the Print/Programs Command menu.
 
3. Type PD.Volume/Filename, Apple Writer's setup for printing to disk on an
   Apple III.
 
4. Type NP to begin printing.
 
6. After the printing to disk is finished, exit Apple Writer and start up
   Business BASIC.
 
7. Run the following program:
 
100   HOME
110   PRINT TAB(10);"APPLE WRITER TO PRINTER"
120   VTAB=5
130   INPUT"PATHNAME OF APPLE WRITER FILE PRINTED TO DISK: ";F$
140   IF F$="" THEN 900
145   VTAB=12
146   INPUT"CHARACTER TO REPLACE: ";X$
147   IF X$="" THEN 145
150   VTAB=10
160   INPUT"Driver Name: (e.g. .PRINTER) ";S$
170   IF S$="" THEN 900
200   ON ERR GOTO 800
210   UNLOCK F$
220   OFF ERR
230   VTAB=12:PRINT SPC(75)
240   PRINT
265   OPEN#1 AS OUTPUT,S$
270   OPEN#2 AS INPUT,F$
280   ON ERR GOTO 400
290   INPUT#2;LINE$
300   A$=""
302   L=LEN(LINE$)
304   FOR Q=1 TO L
306     C$=MID$(LINE$,Q,1)
315     IF C$=CHR$(12) THEN 310
320     IF C$=CHR$(13) THEN 350
330     IF C$=X$ THEN C$=CHR$(31)
340     A$=A$+C$
345     NEXT Q
350   OUTPUT#1
355   PRINT A$
390   GOTO 290
400   OFF ERR
410   CLOSE
430   VTAB=15
440   PRINT TAB(5);"FILE ";F$;" HAS BEEN PRINTED."
450   GOTO 900
800   OFF ERR
810   VTAB=12
820   PRINT CHR$(7);"I CAN'T FIND THE FILE ";F$;"."
830   INPUT"";Z$
840   GOTO 100
900   END


Back