Page 2 of 2

Re: Barcode Scanner vs. TextBox's OnChange

Posted: Fri Aug 24, 2018 6:10 am
by edk
Roberto Lopez wrote: Sun Aug 19, 2018 2:19 pm Apparently, when the data comes from the scanner, it generates ONLY ONE OnChange event.
Perhaps when you program a barcode reader to make longer delays when sending characters to the keyboard buffer, then subsequent OnChange events will appear.

Re: Barcode Scanner vs. TextBox's OnChange

Posted: Fri Aug 24, 2018 10:08 am
by PeteWG
Roberto Lopez wrote: Thu Aug 23, 2018 11:07 pm I've wrote "defensive code" against this possibility, so is not a problem for me, but, I'm simply curious about that :)
I had no doubt you would securing your code against the possibility of two identical bar-codes. ;-)

And like you, curiosity was the "attractor" of my interference in this thread.

I'm using b-codes years now, in a pos app, that's written in harbour textual interface -now slowly transforming it to gui.
I have never encountered such a case of duplicate b-codes in whatever system (EAN-xxx etc) they might be coded.
To the contrary, what I have faced is the situation where the very SAME product has many different bar-codes!!
This is due to the need to cover the different sizes/colors of the same item --usually seen on clothes/shoes etc.
(Anyway, somehow I did manage to cope with it, avoiding the need to create multiple of records for the same item.)

Roberto Lopez wrote: Thu Aug 23, 2018 11:07 pm I've googled it without luck.
Indeed, google has no much to say us about identical b-codes, and perhaps this lack of info is analogous
to the probability that such duplicate bar-codes do exist. Luckily, the world isn't currently bothered by yet another one IT mess. :)

Btw, I suspect that reason the `onChange` event is fired only once, is because scanner sends along with the barcode an `Enter` as a suffix of the digits sequence. Perhaps, the use of `onEnter` event could be considered a good alternative to avoid repeated firing on keybord input, unless it is intentionally designed and aimed to do so.

---
Regards,
Pete

Re: Barcode Scanner vs. TextBox's OnChange

Posted: Fri Aug 24, 2018 10:20 am
by quartz565
Hi Roberto,
Try to change the textbox from onghange to onenter and programming the scanner to send with EAN and the ENTER together. This will bring the entire information to the textbox from the scanner before you start Search.

Re: Barcode Scanner vs. TextBox's OnChange

Posted: Sat Aug 25, 2018 10:42 pm
by Roberto Lopez
dragancesu wrote: Fri Aug 24, 2018 4:03 am What is the type, model?
This will be difficult (or impossible to say) since the scanner comes from an Argentinian dealer that "rebrands" with its name, imported products, so, there is no way to me to answer that.

Re: Barcode Scanner vs. TextBox's OnChange

Posted: Sun Aug 26, 2018 9:51 pm
by franco
I am not sure if this is what you need but when I print a barcode in (font free 3 of 9 extended ) I must put a '*' at start and '* ' at end after
alltrimming the variable or field. Maybe you need to remove the * if it happens to be in the barcode.
This may have something to do with it.
Franco

Re: Barcode Scanner vs. TextBox's OnChange

Posted: Mon Aug 27, 2018 12:08 am
by Roberto Lopez
At first... thanks to all for your answers and suggestions. I've was near to no post about this, since I've believed that could be not enough interest on this topic :D

As I've said, the "thing" was working nicely at the time of my initial post, so, It was just about my curiosity around it.

I've found my own answer to the mystery: It appears to be all about timing (time elapsed between keystrokes).

It is very easy to test:

Code: Select all

		@ 10,10 TEXTBOX Text_1 ;
			ON CHANGE PLAYBEEP()
You simply must to keep pressed some key and let the auto-repeat feature do the rest, At first, you'll ear a single beep, then (when the auto-repeat starts) no more beeps will be generated, until you stop pressing the key.

Since the barcode scanner is sending the "keystrokes" very fast (the same as auto-repeat) a single OnChange event is generated.

Mystery Solved! 8-)

Again... thanks to all for the feedback.

PS: I guess that the timing thing on EN_CHANGE Windows event, is known and (maybe) documented in some Windows programming "bible"... Some Guru outhere ?

Re: Barcode Scanner vs. TextBox's OnChange

Posted: Fri Oct 19, 2018 11:08 pm
by danielmaximiliano
Hola Roberto, estoy muy ausente en el foro, resolvió el problema sobre EAN 13 \ EAN 8