I have been going round and round with this POS issue and appreciate the input I've received here on Tek-Tips. I wanted to share the code that finally works without need for MSCOMM32 or other 3rd party program. I do have a question however... Can anyone explain why the line remarked 'did not work' did not work and the two lines after the remark did work?
Tony
*************************************************************
*** NOTE: (sysinfo.cashstring) is CHR(7) found in sysinfo setup table
nFoundPrinter = 0
nRows = APRINTERS(aPrintArray)
FOR i = 1 TO nRows
aa = AT("DRAWER",UPPER(aPrintArray(i,1)))
IF aa <> 0
nFoundPrinter = i
ENDIF
NEXT
IF nFoundPrinter = 0
* No Drawer - See if it's a pass thru from the RECEIPT printer
nFoundPrinter = 0
nRows = APRINTERS(aPrintArray)
FOR i = 1 TO nRows
aa = AT("RECEIPT",UPPER(aPrintArray(i,1)))
IF aa <> 0
nFoundPrinter = i
ENDIF
NEXT
IF nFoundPrinter = 0
* No DRAWER or RECEIPT
* Nothing
ELSE
SET PRINTER TO NAME (aPrintArray(nFoundPrinter,1))
SET DEVICE TO PRINTER
*** ??? ALLTRIM(sysinfo.cashstring) && DID NOT WORK
cTemp = ALLTRIM(sysinfo.cashstring)
??? &cTemp
SET DEVICE TO SCREEN
SET PRINTER TO DEFAULT
SET PRINTER TO
SET PRINTER TO
SET DEVICE TO SCREEN
ENDIF
ELSE
SET PRINTER TO NAME (aPrintArray(nFoundPrinter,1))
SET DEVICE TO PRINTER
*** ??? ALLTRIM(sysinfo.cashstring) && DID NOT WORK
cTemp = ALLTRIM(sysinfo.cashstring)
??? &cTemp
SET DEVICE TO SCREEN
SET PRINTER TO DEFAULT
SET PRINTER TO
SET PRINTER TO
SET DEVICE TO SCREEN
ENDIF
************************************************************
Tony
*************************************************************
*** NOTE: (sysinfo.cashstring) is CHR(7) found in sysinfo setup table
nFoundPrinter = 0
nRows = APRINTERS(aPrintArray)
FOR i = 1 TO nRows
aa = AT("DRAWER",UPPER(aPrintArray(i,1)))
IF aa <> 0
nFoundPrinter = i
ENDIF
NEXT
IF nFoundPrinter = 0
* No Drawer - See if it's a pass thru from the RECEIPT printer
nFoundPrinter = 0
nRows = APRINTERS(aPrintArray)
FOR i = 1 TO nRows
aa = AT("RECEIPT",UPPER(aPrintArray(i,1)))
IF aa <> 0
nFoundPrinter = i
ENDIF
NEXT
IF nFoundPrinter = 0
* No DRAWER or RECEIPT
* Nothing
ELSE
SET PRINTER TO NAME (aPrintArray(nFoundPrinter,1))
SET DEVICE TO PRINTER
*** ??? ALLTRIM(sysinfo.cashstring) && DID NOT WORK
cTemp = ALLTRIM(sysinfo.cashstring)
??? &cTemp
SET DEVICE TO SCREEN
SET PRINTER TO DEFAULT
SET PRINTER TO
SET PRINTER TO
SET DEVICE TO SCREEN
ENDIF
ELSE
SET PRINTER TO NAME (aPrintArray(nFoundPrinter,1))
SET DEVICE TO PRINTER
*** ??? ALLTRIM(sysinfo.cashstring) && DID NOT WORK
cTemp = ALLTRIM(sysinfo.cashstring)
??? &cTemp
SET DEVICE TO SCREEN
SET PRINTER TO DEFAULT
SET PRINTER TO
SET PRINTER TO
SET DEVICE TO SCREEN
ENDIF
************************************************************