Barcode Scanner vs. TextBox's OnChange

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

edk
Posts: 909
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: Barcode Scanner vs. TextBox's OnChange

Post 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.
PeteWG
Posts: 176
Joined: Sun Mar 21, 2010 5:45 pm

Re: Barcode Scanner vs. TextBox's OnChange

Post 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
User avatar
quartz565
Posts: 667
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Contact:

Re: Barcode Scanner vs. TextBox's OnChange

Post 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.
Best Regards,
Nikos.

os: Windows Server 2019 - 64
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Barcode Scanner vs. TextBox's OnChange

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
franco
Posts: 816
Joined: Sat Nov 02, 2013 5:42 am
DBs Used: DBF
Location: Canada

Re: Barcode Scanner vs. TextBox's OnChange

Post 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
All The Best,
Franco
Canada
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: Barcode Scanner vs. TextBox's OnChange

Post 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 ?
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
danielmaximiliano
Posts: 2611
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: Barcode Scanner vs. TextBox's OnChange

Post by danielmaximiliano »

Hola Roberto, estoy muy ausente en el foro, resolvió el problema sobre EAN 13 \ EAN 8
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Post Reply