Commodore MPS 1000 — Commodore MPS 1000 Dot Matrix Printer User's Manual PDF

In this program we used the number 128 in the DATA statements to signal the end of a print line. This is the reason for the IF-THEN state- ment in line 610 that skips to line 650 and causes a line feed. The other special technique used in this program is found in lines 620 and 630. Since some of the data numbers are repeated many times, we save typing by using negative DATA numbers for repetitions. Line 620 tests for a negative number, and if it finds one, reads the next two numbers and prints their pin patterns the number of times indicated by the negative number.

For example, when the minus 6 in line 800 is read, the program then reads the next two numbers (8 and 0) and sends them to the printer six times. This feature is not a necessary part of the program, but it does allow you to type fewer data numbers. Otherwise the program is a straightforward graphics program that uses 7-dot line spacing and reads numbers from DATA statements and sends them to the printer. If you wane to see the figure in other densi- ties, change the "Y" in line 600 to "L" or "Z ". Graphics Programming Tips Now that we've shown you how co design your own graphics, we'll review and emphasize a few elements of graphics programming.

As usual, we use BASIC in the examples, hue the principles apply to any programming language. Semicolons and command placement After the graphics command is issued, every number sent to the MPS 1000 is interpreted as a pin pattern and printed on paper. Therefore, you must be careful where you put graphics commands in your program. For example, suppose you want a SO-column graphics line with the line spacing set to 7-dot. You might enter the following program: If you are using Commodore BASIC: 5 OPEN4,4 20 PRINT#4, CHR$(27)"K"CHR$(50)CHR$(0) 30 PRINT#4, CHR$(27)" 1" 40 FOR G= 1 TO 50: PRINT#4, CHR$(74): NEXT G 50 CLOSE4 93