Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To Open A Cash Drawer
Message
From
30/01/2003 07:53:14
Raza Malik
Universal Accounting Software
Edgewater, New Jersey, United States
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00746011
Message ID:
00747076
Views:
19
You are write. The first method is the one I was looking for. I just count not figure out how to imbed CHR(0) into a text file. Below is the sample code I used.

Thanks A Million.

Raz


*-- PS_DRW_OPEN
lcPort = UPPER(ALLTRIM(_Screen.cDrw_port))
DO CASE
CASE lcPort = 'NONE'
RETURN
CASE SUBSTR(lcPort,1,3) = "LPT"
IF FILE("C:\vUAS\CONTROL.CHR") = .T.
WAIT WIND "...Opening drawer" NOWAIT

*-- Get Default Printer
=APRINTERS(PP)
lnI = ALEN[PP,1]
FOR lnI =1 TO lnI
IF AT("RECEIPT", UPPER(ALLT(PP[lnI,1])) ) > 0
SET PRINTER TO NAME PP[lnI,1]
* !TYPE F:\vUAS\CONTROL.CHR >LPT1
!TYPE C:\vUAS\CONTROL.CHR >LPT1
WAIT CLEAR
EXIT
ENDIF
ENDFOR
ENDIF
RETURN
CASE SUBSTR(lcPort,1,3) = "COM"
* load mscomm
*ThisForm.oComm = CREATEOBJECT('MSCOMMLib.MSComm')
DO CASE
CASE lcPort = "COM4"
ThisForm.oComm.CommPort = 4
CASE lcPort = "COM3"
ThisForm.oComm.CommPort = 3
CASE lcPort = "COM2"
ThisForm.oComm.CommPort = 2
OTHERWISE
ThisForm.oComm.CommPort = 1
ENDCASE

IF EMPTY(_Screen.cDrw_init)
ThisForm.oComm.Settings = "9600,N,8,1"
ELSE
ThisForm.oComm.Settings = ALLTRIM(_Screen.cDrw_init)
ENDIF

*-- If port is open close it first
IF ThisForm.oComm.PortOpen
ThisForm.oComm.PortOpen=.F.
ENDIF

ThisForm.oComm.RThreshold = 1
ThisForm.oComm.SThreshold = 1
ThisForm.oComm.RTSEnable = .F.
ThisForm.oComm.InputLen = 0

ThisForm.oComm.PortOpen = .T.
ThisForm.oComm.output = ALLTRIM(_Screen.cdrw_code)

*-- Close the port
ThisForm.oComm.PortOpen = .F.
ENDCASE
RETURN
Previous
Reply
Map
View

Click here to load this message in the networking platform