TITLE Apple Writer IIe under ProDOS: Printer codes from all Apples Article ID: 29 Created: 4/30/86 Modified: 2/23/98 -------------------------------------------------------------------------------- TOPIC Many printers have special features that the computer signals by sending command codes. To send codes to a printer from Apple Writer IIe (version 2.1) under ProDOS, 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. -------------------------------------------------------------------------------- DISCUSSION 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 keyboards of the Apple IIe, Enhanced Apple IIe, or Apple IIc. 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. 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: You must simultaneously hold down the control key, the shift key, or both as you press the other key, or You must press a special key, such as ESC or RETURN. With these considerations in mind, here is a list of codes and methods for inserting them in an Apple Writer file. Null (ASCII value 0): Because Apple Writer IIe (version 2.1) under ProDOS 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: Control-A through Control-Z (ASCII decimal values 01 through 26): Example: Control-Z (ASCII decimal value 26): Exception: Control-V (ASCII decimal value 22) can't be entered. See "Missing Characters" below. Escape (ASCII value 27): Other Control characters: These can be entered in the manner of Control-A through Control-Z. Missing Characters: In typing a file, there is no way to put a Control-V into the text. During printing, Apple Writer doesn't send a Control-Underline as such. 1. Applesoft BASIC can be used to send a Control-V or Control-Underline to your printer. 2. Create your Apple Writer document as usual, but substitute unique characters in each place that you want a Control-V or Control-Underline character. 3. Type to display the Print/Programs Command menu. 4. Type PD8, Apple Writer's code for Print to Disk on an Apple II. 5. Type NP to begin printing. 6. To the Apple Writer prompt for a file name, do not enter the same name with which the file is already saved. Enter a unique name, and note it down. 7. After the printing to disk is finished, exit Apple Writer and boot up a ProDOS diskette. Run the following program, using the following forms of line 330: Control-V 330 IF C$=X$ THEN C$=CHR$(22) Control-Underline 330 IF C$=X$ THEN C$=CHR$(31) 100 HOME 110 PRINT TAB(10);APPLE WRITER TO PRINTER" 120 VTAB 5 130 INPUT "NAME 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 "PRINTER SLOT #: ";S$ 170 IF S$="" THEN 900 180 S=VAL$(S$); IF S < 1 OR S > 7 OR INT(S) <> S THEN 150 190 D$=CHR$(4) 200 ONERR GOTO 800 210 PRINT D$;"UNLOCK";F$ 220 POKE 216,0 230 VTAB 12: PRINT SPC(75) 240 PRINT 250 PRINT D$;"PR#";S 260 PRINT CHR$(9);"132N" 270 PRINT D$;"OPEN";F$280 ONERR GOTO 400 290 PRINT D$;"READ";F$ 300 A$="" 310 GET C$ 315 IF C$=CHR$(12) THEN 310 320 IF C$=CHR$(13) THEN 350 330 IF C$=X$ THEN C$=CHR$( ): REM Substitute ASCII value for unique character 340 A$=A$+C$:GOTO 310 350 PRINT A$ 390 GOTO 300 400 POKE 216,0 410 PRINT D$;"CLOSE" 420 PRINT D$;"PR#0" 430 VTAB 15 440 PRINT TAB(5);"FILE ";F$;" HAS BEEN PRINTED." 450 GOTO 900 800 POKE 216,0 810 VTAB 12 820 PRINT CHR$(7);"I CAN'T FIND THE FILE ";F$;"." 830 INPUT "";Z$ 840 GOTO 100 900 END