Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
From barcode scanner to table field
Message
From
22/02/2011 15:51:55
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01499921
Message ID:
01501320
Views:
39
I don't understand exactly what you want. Anyway, the easiest is usually to create a form with whatever objects you need, where one of the objects is a textbox to input text to search for. You set up this form first, and make sure that it works with data from the keyboard. Then, when it is working with data from the keyboard you simply use the barcode reader instead of the keyboard.

If you want to make the program understand that the input comes from the reader, you can program the scanner to send some code BEFORE the real text, lets call it pretext. Your program must have a handler, for instance in the keypress of the form, which reads the input and if it recognizes this pretext, it sets focus to the correct textbox.

I have never done this myself, so unfortunately I can't help you more than this. I know that it's possible, maybe someone else can provide more help?

NB! You probably must program the reader to add a carriage return, chr(13), after the text is read.

>Hi
>
>I have the bar code scanner now
>
> Code reads OK directly to the field of table.
>
>But I would like to automate as below:
>
>Locate for field = my_locate_code_read_from_scanner
>
>( I could have a small code bar on label just to locate the record in table and other bar code is the real code whith will be filled .)
>
>The manual explains how to configure F1, F2 function etc at the end of reading string.
>
>So I would put "Locate for field ..." inside F2 function key, but I have no idea how to get my_locate_code_read_from_scanner
>
>Can I automate at the level, or do I really need the place in each record of
>table and then read with scanner ?
>
>Its an USB scanner.
>
>Moises
>
>
>
>
>
>
>
>
>
>
>
>
>
>>Yes, it's really only "plug and play". But be aware that you probably must program the scanner to match the keyboard layout of your choice. The scanner decodes the bar code and sends a stream of "scan codes" to your computer, just like a keyboard sends scan codes to your computer. But some characters, like - and % have different positions on the keyboard in different countries, and that's why you must program the keyboard to your own keyboard layout.
>>
>>>Thank you Tore
>>>
>>>It was much easier simple than I thought
>>>
>>>Moises
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>>Moises,
>>>>
>>>>it's so much easier than you think. Think of a bar code scanner as a keyboard, because to all your software it is just that, a second keyboard.
>>>>
>>>>In addition most bar code scanner can be programmed to insert one or more characters of your choice before and/or after the scanned text. This means that it is possible to determine whether the input comes from the keyboard or from the scanner, if these extra characters are enabled.
>>>>
>>>>>Hi
>>>>>
>>>>>I never used bar code scanner before.
>>>>>
>>>>>( the first bar code I built was for post mail scanner tracking machine)
>>>>>
>>>>>Now am considering have one for my use and I have two questions:
>>>>>
>>>>> 1- Will the code go direct to the a table field the same way as I was typing a keyboard ?
>>>>>
>>>>> 2- Is there way to automate as below ?
>>>>>
>>>>> loca for table.id = my_read_value_from_code_bar
>>>>>
>>>>>I wonder if the scanner send some command after bar was read and if vfp can detect if directly.
>>>>>
>>>>>
>>>>>Moises
Previous
Reply
Map
View

Click here to load this message in the networking platform