On Jan 23, 2007, at 23:13 UTC, Chad Bullock wrote: > > Or, are you resetting the String1 between reads? > > I was mainly going off the example in the LR for that one. They have: > > Sub DataAvailable() > EditField1.Text=EditField1.Text+ Me.ReadAll()
Ouch, I cringe every time I see that one. This is absolutely the worst way to append data to an EditField. To say nothing of the needless parentheses after the ReadAll call. :) What it should say instead is: EditField1.AppendText Me.ReadAll But note that your method works fine, it's just slower than it could be (better would be to make an array of strings and .Append me.ReadAll to it). > The device would be sending back a couple hundred lines of ascii > text, each with a linebreak. I wasn't exactly sure how often the > DataAvailable event is actually fired (didn't test that yet either); > I'm assuming it's just when *any* data is available, so I guess it > would be called for each and every single character that comes > in...is that right? No, it may only be called once, or it may be called several times. Basically it'll call DataAvailable whenever it feels like it. :) > The only other thing I could think of was to have a timer continually > poll the serial with lookahead, and when it finds a linebreak, it > adds it to the string; but it seemed like an inefficient method of > just doing what the DataAvailable event does already. Do you know > what would be a better alternative? What you're doing is acceptable; appending to an array of strings is even better. But this isn't the source of the problem. Speaking of which, are you SURE you're not calling .Poll anywhere in your test code? Best, - Joe -- Joe Strout -- [EMAIL PROTECTED] Verified Express, LLC "Making the Internet a Better Place" http://www.verex.com/ _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>
