Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Barcode scanning as input
Message
 
To
27/09/1999 22:02:52
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00266232
Message ID:
00269802
Views:
25
Scott,

It could be the dodefault statement at the end of your code. I'm sure it is redundant, I'm not sure if that is your problem, but it does not cost anything to try.

The only problem I have is synchronisation between the reader and the program, sometimes what comes into the barcode string is not complete, but that is rare, and I guess if I upgraded the workstation to a faster machine, the problem would go away.

Marc


>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

If things have the tendency to go your way, do not worry. It won't last. Jules Renard.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform