#IF 'VISUAL' $ UPPER(VERSION()) && VFP6/7 *the variable port is filled with a value from a table *each report has a record in a table where the user can *choose which printer to send that report to. The port *field is populated with getprinter() in a printer setup form PRIVATE gnPos PRIVATE ARRAY gaPrinters(1,2) =APRINTERS(gaprinters) gnPos = ASCAN(gaPrinters,port) && Search for printer name IF LEN(ALLTRIM(port))=0 OR gnPos=0 && not found *--If no printer is setup,then use the default windows printer port = SET('PRINTER TO',2) ENDIF port=LTRIM(port) SET PRINTER TO NAME (port) #ELSE && FPD26 SET PRINTER TO junk EJECT SET PRINT TO &port #ENDIF SET DEVICE TO PRINTWhen finished printing, we call a program called prntreset:
#IF 'VISUAL' $ UPPER(VERSION()) && VFP6/7 SET CONSOLE ON SET DEVICE TO SCREEN SET PRINT TO ACTIVATE SCREEN #ELSE && FPD26 SET DEVICE TO SCREEN SET PRINT TO IF !EMPTY(postdos) && specific reset codes for some printers RUN /64 &postdos ENDIF #ENDIF RETURN>Hi guys...