Technology Dock - Information Technology Articles

xBASE Printer Control - October 1992
(Archive Article)
by Dean S. Tripodes

[Man at PC]

It's happened to you before. You need to use dBASE or FoxPro to send a report to a Hewlett Packard Laser Jet printer. But you aren't familiar with the built in printer driver, and maybe you just one to be able to switch from portrait to landscape, and 10 cpi to 17 cpi and back. It shouldn't be that tough, but it seems complicated. With our PRINTAID utility, you can set up your printer before you send any report, label, or list output.

* PRINTAID
*
* Quick print utility to change Laser Jet family print modes
*
CLOSE DATABASES
SET COLOR TO W/B
CLEAR
SET TALK OFF
SET ECHO OFF
SET STATUS OFF
HPP_10CPI = 'CHR(27)+"&l0O"+CHR(27)+"E"'
HPL_10CPI = 'CHR(27)+"&l1O"+CHR(27)+"E"'
HPP_17CPI = 'CHR(27)+"&l0O"+CHR(27)+"(s16.66H"'
HPL_17CPI = 'CHR(27)+"&l1O"+CHR(27)+"(s16.66H"'
TVALID = .F.
@ 1, 1 TO 3, 78 DOUBLE
@ 2, 3 SAY 'PRINTAID.PRG'
@ 5, 10 SAY 'Foxpro / dBASE HP Laset Jet printer setup utility'
DO WHILE .NOT. TVALID
TCHOICE = ' '
@ 8, 10 SAY '1) Portrait, 10 cpi'
@ 9, 10 SAY '2) Portrait, 17 cpi (compressed)'
@ 10, 10 SAY '3) Landscape, 10 cpi'
@ 11, 10 SAY '4) Landscape, 17 cpi (compressed)'
@ 14, 10 SAY 'What is your choice? ' GET TCHOICE PICTURE '9' ;
VALID (TCHOICE $ '1234')
@ 23, 28 SAY 'Press to Quit'
READ
IF READKEY() = 12 .OR. READKEY() = 268
QUIT
ENDIF
TVALID = .T.
ENDDO
SET PRINTER ON
SET CONSOLE OFF
DO CASE
CASE TCHOICE = '1'
?? &HPP_10CPI
CASE TCHOICE = '2'
?? &HPP_17CPI
CASE TCHOICE = '3'
?? &HPL_10CPI
CASE TCHOICE = '4'
?? &HPL_17CPI
ENDCASE
@ 18, 10 SAY 'Done! Press any key to Quit'
SET PRINTER OFF
SET CONSOLE ON
?? CHR (7)
SET CONSOLE OFF
WAIT
SET CONSOLE ON
SET STATUS ON


Terms of Use For Baywalk - Use of Baywalk signifies your agreement to the terms of use.



Top of Page