Chapter 6: Graphics Commands for 9-Pin Printers54Programming Graphics in BASICOne important thing to remember when you're programming graphics is not to includeextraneous line feeds in your programs. Using a semicolon after the data in an LPRINTstatement will keep the print position on the same line.However, there is an additional complication: by default, BASIC assigns to all printers amaximum line length of 80 characters. After the printer has received 80 bytes of data, it willautomatically perform a carriage return and line feed. Since graphics data typically consists ofmany bytes, it's quite easy to exceed this limit. The resulting output will be garbled. You canwork around this problem by setting the line length to the maximum allowable value, 255. Putone of these statements at the beginning of your program:For parallel printers:WIDTH “LPT1:”,255For serial printers that have been opened as #1:WIDTH #1,255Graphics Density Selection Commands (IBM/E) ML320 E/I, ML321 E/I ML320 Turbo, ML321 Turbo ML520, ML521Function ASCII Dec HexBegin Single DensityGraphicsESC K Ln Hn [data] 27 75 Ln Hn [data] 1B 4B Ln Hn [data]Double DensityGraphics CommandESC L L n Hn [data] 27 76 Ln Hn [data] 1B 4C L n Hn [data]Double Speed/Double DensityGraphics CommandESC Y Ln Hn [data] 27 89 L n Hn [data] 1B 59 Ln Hn [data]Quadruple DensityGraphics CommandESC Z Ln Hn [data] 27 90 Ln Hn [data] 1B 5A L n Hn [data]These graphics modes correspond to the 8-pin modes and are supported by most currentDOS-based graphics software.Parameters Ln and H nThese parameters tell the printer how many bytes of graphics data to expect. Eight-pin graphicshave one byte of data per column. To calculate the values for L n and Hn , first determine howmany columns of dots there will be in your graphics image. Divide this number by 256 andassign the whole number result to Hn ; assign the remainder to L n .