After the entire figure is created in the array in memory it is sent to the printer. Since we are using a 24-dot graphics option the procedure is slightly complicated. The array in memory is structured just as the figure will print: array element 0,0 is the upper left corner, 1,0 is adjacent to it on the right, and 0,l is directly below it. But when we print the array, we must send the array elements in “stacks” of three. Each array element contains one byte of graphics data, and to control 24 nozzles we must send three bytes of data to the printer. Figure 6-10 shows the order in which we must send the array elements to the printer.
First print line
Second print line
Third print line
Additional print lines
The bold italic numbers indicate the order that the bytes of graphics data, contained in the array elements, are sent to the printer.
Figure 6-10. Order of array elements
The printing routine starts in line 520. This program was written on a Compaq computer, and this method of opening the printer as a file avoids most problem codes with this computer. Line 530 changes the line spacing to 24/180-inch so that there will be no gaps in the printed design.