Results 1 to 3 of 3
Thread: Reading barcodes
Apr 25, 2007, 08:17 #1
- Join Date
- Nov 2005
- 0 Post(s)
- 0 Thread(s)
would be the same as typing it on my keyboard, but of course much faster. The problem lies in my "API" which dosn't always respond to the barcode length correctly, hence executing the actions at the wrong time (see code below).
A scenario in my application would be to separate multiple barcodes with a semicolon, which is what I'm trying to do with the code below. Copy paste the following code, and run it in your browser:
OBS! Only tested i Opera (since I'm developing for a closed enviroment)
2. Type 50505050505050505050505050... on your keyboard at a rate that types in at least 7 numbers/5seconds, to emulate the barcode reader. (the timeout is usually 300ms insted of 5 seconds when having the acutal barcode reader attached)
In a perfect world, this would be manipulated to (notice that all barcodes has a length of 7 numbers):
But it dosn't, I'm sure it's looking more like this: (where some barcodes where separated to early or to late. Some are of 6 numbers in length, some 7, which is the correct, and some are even 8!):
Try to type the numbers very fast and slow (but within 5 seconds).
Why doesn't my code always separate my barcodes evenly?
(note: I know you can program a barcode reader so it sends a certain keystroke, eg. ; after each scan, but that's not an option since I'm calling different functions in my application)