Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Barcode scanning as input
Message
De
27/09/1999 22:02:52
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00266232
Message ID:
00269753
Vues:
28
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform