>Hello comunity
>
>I need to know how to build a simple PRG to opening my cashdrawer that was connect to my printer Epson Tm-T88II .
>Also, if someone could give me an example using ports COM1 or LPT1.
>The ideia is create a shortcut on windows desktop an clicking on them, the PRG send the correct ASCII code to opening my cashdrawer .
>
>If is only possible on my VFP application calling the PRG or FXP, that´s not represent any problem, because i can use any combination of keyboard , ex : CTRL+F12 to call them.
>
>I search on the WEB but i couldn´t find any example.
>
>Many Thanks
>Luis Santos
Hi Luis,
This works for me. You wouls have to substitute the name of YOUR receipt printer for oAPP.receipt printer. My OS is XP PRO so that may also make a difference>
LOCAL lcOldPrinter
lcOldPrinter=SET('PRINTER',2)
TRY
SET PRINTER TO NAME (oAPP.receiptprinter)
SET PRINTER off
??? Chr(27)+CHR(112)+chr(0)+chr(64)+chr(240)
SET PRINTER on
SET PRINTER OFF
SET PRINTER TO NAME (lcOLDPrinter)
CATCH
FINALLY
ENDTRY