|
FORUMS PROFESSIONNELS WINDEV, WEBDEV et WINDEV Mobile |
| | | | | |
Scanning/Parsing EAN Barcodes |
Débuté par DAVE SUMMERS, 17 nov. 2016 17:07 - 4 réponses |
| |
| | | |
|
| |
Posté le 17 novembre 2016 - 17:07 |
Hi
Don't know if anyone can help or has had experience with this in WX?
I am developing a hand held barcode scanning project on WDMobile 21. Focus is in an EDIT control and an EAN128 barcode is scanned, this correctly populated the EDIT control. Within the data returned, i need to parse out/identify the separator FNC1 used to identify the end of variable data within certain AI's
e.g a barcode might be 1516123110ABC11160101 (human readable would be (15)161231(10)ABC(11)160101
The AI's (15) use by date and (11) manufacture date are fixed length data but (10) batch code is variable length therefore FNC1 is used to mark the end of the data allowing you to parse the next AI
Does anyone know the best way in Wlanguage/functions to do this from the data captured in the EDIT control (or keyboard input buffer) from the scanner ?
Any help would be much appreciated
Regards Dave |
| |
| |
| | | |
|
| | |
| |
Posté le 17 novembre 2016 - 19:43 |
Hi Dave,
I do not thing that any control character will make it into an edit field
If I'm wrong, you can find it with the position function. If I'm right, you need to find your stuff another way.
You gave us only oe example, so I'm not sure, but it looks like your (10) is followed by LETTERS...
If that's always the case, then you could loop throught the string, and as soon as you find a letter (and not a number), you know what your batch number is
BEst regards
-- Fabrice Harari International WinDev, WebDev and WinDev mobile Consulting
Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM (open source)
More information on http://www.fabriceharari.com
Le 11/17/2016 à 11:07 AM, DAVE SUMMERS a écrit :
Hi
Don't know if anyone can help or has had experience with this in WX?
I am developing a hand held barcode scanning project on WDMobile 21. Focus is in an EDIT control and an EAN128 barcode is scanned, this correctly populated the EDIT control. Within the data returned, i need to parse out/identify the separator FNC1 used to identify the end of variable data within certain AI's
e.g a barcode might be 1516123110ABC11160101 (human readable would be (15)161231(10)ABC(11)160101
The AI's (15) use by date and (11) manufacture date are fixed length data but (10) batch code is variable length therefore FNC1 is used to mark the end of the data allowing you to parse the next AI
Does anyone know the best way in Wlanguage/functions to do this from the data captured in the EDIT control (or keyboard input buffer) from the scanner ?
Any help would be much appreciated
Regards Dave |
| |
| |
| | | |
|
| | |
| |
Posté le 17 novembre 2016 - 23:45 |
Hi Fabrice
Many thanks for your reply.
Unfortunately, you cannot detect based on the data, a batch code could be alpha, numeric or mixed.
Another scenario is if the AI (article identifier in EAN-128 barcode) for quantity is used, again a variable length data field
In 'progress 4gl' we do a 'readkey' on the keyboard input (data the scan engine sends) and we can check the ascii value of each character and therefore detect the FNC1 separator.
Dave |
| |
| |
| | | |
|
| | |
| |
Posté le 18 novembre 2016 - 09:34 |
Hi Dave
in that case, you can use the event function with the (from memory) WMkeypressed event and do the same
Best regards
-- Fabrice Harari International WinDev, WebDev and WinDev mobile Consulting
Ready for you: WXShowroom.com, WXReplication (open source) and now WXEDM (open source)
More information on http://www.fabriceharari.com
Le 11/17/2016 à 5:45 PM, DAVE SUMMERS a écrit :
Hi Fabrice
Many thanks for your reply. Unfortunately, you cannot detect based on the data, a batch code could be alpha, numeric or mixed.
Another scenario is if the AI (article identifier in EAN-128 barcode) for quantity is used, again a variable length data field
In 'progress 4gl' we do a 'readkey' on the keyboard input (data the scan engine sends) and we can check the ascii value of each character and therefore detect the FNC1 separator. Dave |
| |
| |
| | | |
|
| | |
| |
Posté le 21 novembre 2016 - 19:49 |
Cheers Fabrice, i'll give that a go
Many thanks for your help - these forums owe a lot of their success to your continual help and advice it is much appreciated
Dave |
| |
| |
| | | |
|
| | | | |
| | |
| | |
| |
|
|
|