* ---------------------------------------------------- PROCEDURE OpenDrawer * open receipt drawer if !mlOpenDrawer return endif do case case station.printer=2 && dumb as, laser etc - no drawer return case station.printer=3 && Epson TM-U21OD Receipt Printer do PrintLine with chr(27)+'p0((', .t. otherwise && Star SP210 - may have drawer do PrintLine with chr(28), .t. endcase return * ---------------------------------------------------- PROCEDURE PrintLine * print receipt line or control code to appropriate device PARAMETERS pcString, plControl PRIVATE mcWriteBuff, mcString, mlControl, mnWritten, mnHandle mlControl=iif(type('plControl')='L',plControl,.F.) * fix mcString for printer type if !mlControl do case case station.printer=2 && dumb as, laser etc with CRLF mcString=pcString+chr(13)+chr(10) otherwise && Star SP210 - LF only mcString=pcString+chr(10) endcase else mcString=pcString endif do case case station.port=4 * no print, no nothing... otherwise erase (mcRecFile) mnHandle=fcreate(mcRecFile) =fwrite(mnHandle, mcString) =fclose(mnHandle) * this MAY be necessary to let caching etc settle =inkey(.1) do case case station.port=1 && LPT1 copy file(mcRecFile) to lpt1 case station.port=2 && LPT2 copy file(mcRecFile) to lpt2 case station.port=3 && LPT3 copy file(mcRecFile) to lpt3 otherwise * com ports...not implemented in SO32 (yet) * but can easily be redirected to an LPT port - yes, it works! endcase erase (mcRecFile) endcase return * ------------------------------------------ PROCEDURE ResetPrinter * some printers need special reset (lasers etc) do case case station.printer=2 && generic printer * Generic printer, send formfeed =PrintLine(chr(12), .T.) otherwise * do nothing endcase returnHTH