Hi Folks,
i'm preparing a migration/port of an Excel-VBA-Script to FPC/Lazarus.
Current Situation:
We have bins/containers in our CleanRoom.
Each bin has 2 Barcodes: PartNumber and StockLocation --> A bin will never change content and location
The current Excel-Script offers two textFields: one for PartNumber, one for Location, meaning the ladies have to scan each bin twice
Issue: If the Ladies are not careful, they scan the Location into the PartNumber-Field and vice versa
Example Part-No.: 123456 (always 6 Characters)
Example Location: RR5012 (always 6 Characters)
With the Migration i'll propose a change of the Barcode-Labels on the Bins: One Barcode containing "123456RR5012"
(To save the ladies the second scan, and avoiding the "scanned into the wrong TEdit")
Question: Any ideas/advice on efficient parsing?
The proposed change of labels will probably be a "running" change, meaning: The labels will not get changed in one go,
since the Cleanroom has extremely restricted Access.
Meaning: i'll have to provide for both versions of the Barcode(s)
I was thinking:
1) Check for Length of Text
2) If Length=12 Then NewLabel --> Split it up, the left 6 Chars being PartNo, the right 6 Chars being Location
3) If Length=6 Then OldLabels --> Check if text starts with "RR". If Yes Location Else PartNo. (Optional: If PartNo Then tryToConvertToInteger If Yes Everything OK Else Error)
3b) The Ladies would still have to scan a second time. I was thinking keeping a Flag "FirstScan was PartNo. Second Scan must be Location" or some such
All "correctly" scanned Barcodes will be collected into a StringGrid, separated by PartNo., Location (and some more Data from a Database, but having nothing to do with the Barcodes)
Is my logic sound?
Note: I'm asking for the Logic.
Code is not a problem once i know which road leads to Rome.....