Ken Thornton-Smith ha scritto: > I'm entering numbers from an RFID tag reader into a text box. > A keypress event here opens another text box and moves cursor focus. > > Obviously, the first character opens the second textbox and the rather > slow usb puts the remaining characters in the second box. > Being lazy, instead of looking for the complete string, I put in WAIT > 0.5. > > This enters the correct string but the string is now in the first box > in reverse. > Keyboard entry has a similar effect. > > Gambas 2, no code necessary, works on two machines in any text box. > > Any theories? > I am not sure to well understand, but it seems that, for every character, the first textbox looses focus and gains it again. This moves the text cursor at the beginning, so arriving characters are stored in reverse order. Is it this that happens?
You can put PRINT statements in the event handlers to trace what controls take focus (and hence, the arriving characters). You can use Application.ActiveControl to know, at any time, what control has the focus. Anyway, try to use a single-shot timer instead of a WAIT: it could behave differently. Hope this helps, -- Doriano Blengino "Listen twice before you speak. This is why we have two ears, but only one mouth." ------------------------------------------------------------------------------ OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user