Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Barcode scanning as input
Message
From
27/09/1999 22:02:52
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00266232
Message ID:
00269753
Views:
26
Michael,
I tried using something verrrry similar to your code, but I can't seem to process normal keystrokes. Only scans get input. Can you help?

Scott



LPARAMETERS nKeyCode, nShiftAltCtrl
LOCAL c
c= CHR(nKeyCode)
*-- the string read from the barcode is compiled into this.cBarcode
*-- this.lBarcodeReading is a flag to set barcode reading. (Simple keyboard
*-- input is processed as well).

IF !THIS.lBarcodeReading AND ! c $ 'TPNFPAEDX0123456789'
*-- key input not a number or button key
*-- set barcode reading on
THIS.lBarcodeReading= .T.
*-- initiate the compile string and save the character
THIS.cBarcode= c
ThisForm.Timer1.Enabled = .T.

* Add a new record
THISFORM.BUTTONSET1.cmdAdd.CLICK()
THISFORM.LBLDATE1.Text1.VALUE = DATETIME()
THISFORM.EMPID1.Text1.VALUE = gcEmpID
THISFORM.REFRESH

NODEFAULT
RETURN
ENDIF

IF THIS.lBarcodeReading
*-- barcode reading ends with a CR
IF c= CHR(13)
*-- deactivate barcode reading
THIS.lBarcodeReading= .F.
*-- do your thing with the compiled string
THISFORM.ProcessFixedScan()
ThisForm.cBarCode = ""
NODEFAULT
RETURN
ENDIF
*-- compile the string
THIS.cBarcode= THIS.cBarcode+c
NODEFAULT
RETURN
ENDIF

*-- otherwise process keyboard input
=DODEFAULT(nKeyCode,nShiftAltCtrl)
RETURN
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform