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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only