Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EPOS! I Reading from a BarCode Scanner 2

Status
Not open for further replies.

kozy

Programmer
Dec 24, 2002
4
0
0
GB
I'm using a BarCode Scanner to read info into my app. The problem I'm having is what event to use to analyse the info recieved or which component to use.
Basically I'm reading a value and looking it up in a database, but the focus is never gained or lost by the edit box. If the value is found then apporpriate data is displayed or the edit box is reset. I can't use the on change event because this occurs for each character recieved.
Any ideas?
 
How about using the OnChange event and checking if it's the right length before looking it up?
 
It sounds as if you're using a keyboard wedge with your scanner to read the data into an edit box. Might I suggest OnChange as an event to process the data on.

If you are connecting your scanner via a serial port, I would suggest looking at the ASync Pro components from TurboPower ( You can use these to capture the data as the port receives it and then do whatever processing you like with it.
 
My solution to a similar problem: The barcode reader is programmed to add an unusual character before and after the code (different characters). When I get the initial character I figure it's probably a barcode and the barcode analyzer is activated. When I get the trailing character I check the buffer to see if what I got is a properly formatted barcode message.
It is possible for a human to type it in but it would be awfully hard to do so by accident.
 
I have some experience working with barcodes. In every case I know of, when scanned the barcode itself was followed by a carriage return. I don't know if this is always true, but if this is the case in your situation, then you can use OnKeyDown and test for VK_Return.
 
Thanx everyone, you pointed me in the right direction! I reprogrammed the Bar code Scanner.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top