* * ENVADDR.KEX * * Print the currently marked box block as the address on an envelope. This * requires that a mono-spaced printer font be used. * * Works with: * * KEDIT 5.0 for DOS * KEDIT 5.0 for OS/2 * if block.1() = 'NONE' then do "emsg ENVADDR Error 1: No box block is currently marked" exit 1 end if block.1() \= 'BOX' then do "emsg ENVADDR Error 2: Only box blocks are supported" exit 2 end if block.6() \= fileid.1() then do "emsg ENVADDR Error 3: The block is not located in the current file" exit 3 end CurrentLine = line.1() * Escape character ESC = d2c(27) ***** Printer-Specific Data ***** * This is currently set up for an HP Laserjet so you may need to make changes * if your printer is not Laserjet compatible. * How many columns to pad the address on the left LeftMargin = copies(" ", 66) * How many lines to skip down before we print the first line of the address TopMargin = 25 * Escape sequences needed to set up the printer LandscapeMode = ESC || '&l1O' ManualFeed = ESC || '&l2H' * Escape sequences needed to reset the printer when we're done PortraitMode = ESC || '&l0O' AutoFeed = ESC || '&l1H' ***** Printer-Specific Data ***** 'print string' LandscapeMode || ManualFeed 'sos blockstart' BoxHeight = block.4() - block.2() + 1 * Skip down to the line we'll start printing at do TopMargin 'print line' end do BoxHeight Line = substr(curline.3(),block.3(),block.5() - block.3() + 1) 'print line' LeftMargin || Line 'down 1' end 'print string' PortraitMode || AutoFeed ':'CurrentLine 'print close'