Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MS Comm experts
Message
From
11/02/2002 08:27:52
 
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00614817
Message ID:
00618250
Views:
34
I'm glad you got it working David, but I think WAY BACK WHEN I got that idea (pausing to clear the buffer on fast computers) from Jim Livermore originally! I have to do it on really FAST computers, but not on slow/moderate ones. It seems to have something to do with speed of the uart chip in the port and the drivers too.

Tracy

>Yes, I finally got it to work. Thanks to Tracy I put a inkey(1) (at the beginning of the Oncomm) to wait a second so the buffer can clear itself out.
>
>We can close this case now. 8-) Thanks again!!!
>
>>First, the last thing you should be doing is THISFORM.buffer = "". Try something like this instead:
>>
>>if this.commevent = 2
>>   thisform.buffer = thisform.buffer + this.input
>>   * Assuming a CR at the end of the scan
>>   IF CHR(13)$THISFORM.inbuffer
>>       lnscansize = AT(CHR(13),THISFORM.inbuffer)
>>       * extract scan
>>       lcmydesiredscan = SUBSTR(THISFORM.inbuffer,1,lnscansize)
>>       *delete scan
>>       THISFORM.inbuffer = SUBSTR(THISFORM.inbuffer,lnscansize+1)
>>   ENDIF
>>
>>or something similar. This leaves the .inbuffer intact in the case there are multiple scans in the buffer.
>>
>>
>>>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?
>>>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform