AppendixC Formatting Examples These programs illustrate the many formatting capabilities of your printer in Commodore mode. The first program is completely anno- tated. In the following programs, new concepts are commented upon. Simple String Formatting This program opens for files to perform four different tasks . It prints three lines: the format string, the unformatted data string, and the formatted data string. Here is a printout from the program:
MMMAA ABC AB AB AB AB 10 OPEN 1,4 20 OPEN 2,4, 1 30 OPEN 3,4,2 40 OPEN 4,4,4 50 PRINT#4 60 A$=''AAAAAAM' 70 = ''ABC" 80 PRINT #l ,A$ 90 PRINT #l,B$ :REM ENABLE ERROR DIAGNOSTICS :REM FORMAT STRING :REM STRING TO BE FORMATTED 100 PRINT #3 ,A$ 110 = CHR$(29) 120 PRINT #2,B$C$B$C$B$C$B$ 130 CLOSE !:CLOSE 2:CLOSE 3:CLOSE4 Ao analysis of the program will help you understand how it works. C-1