Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MS Comm experts
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00614817
Message ID:
00616662
Views:
40
I am still trying to figure out what is going on here. In the OnComm method I have
if this.commevent = 2
   thisform.buffer = ""
   thisform.buffer = this.input
...
Then when I debug the first time it is fine. The second time it looks like it adds the input to the previous input but it is truncated. Not 2 complete data scans. What do I need to do to reset this object?


>Reading the control.input does indeed clear THAT buffer. The buffer I was referring to is your form property that your are .input - ing into.
>
>If your read up to your terminating character, what do you do if more data is in the buffer? Throw it away? Keep it until next time? Do you remove just what you want, then discard the rest? These are decisions you must make :>) If you have the data you need from your scan, and don't care after that, a simple
>
>THISFORM.yourbufferproperty = ""
>
>will take care of clearing the buffer.
>
>Depending on your application, sometimes it is desirable to process the data in chunks. Let's say you have incoming text stream with CRLF combinations as a terminator. If I search the buffer for the CRLF pair, I know I have a complete line intact and can extract that from the buffer, and THEN delete that line from the buffer, leaving the remaining intact as it is incomplete at this moment. Does that make any sense?
>
>>What is the best way to clear buffer? Of course, I am clearing the form buffer property everytime the oncomm is called. It looked like the input property cleared out by it self. How can I make sure the buffer is cleared?
DLC
"Use the Right Tool for the Job!"
davidandcynthia@email.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform