Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to read string from serial port for bar code app
Message
From
02/05/2002 15:41:15
 
 
To
02/05/2002 15:30:30
Patrick O'Neil
American Specialty Information Services
Roanoke, Indiana, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00651375
Message ID:
00652087
Views:
28
Patrick,

You are correct if you are placing the control on a form, the event fires nicely. Look at my code - no form, no textbox, nada. Try it for yourself :>)

UPDATE:

You are also correct about the looping - assuming all your processing code is maintained within the ONCOMM event. Others here have convinced me that this is not very OOPy - "Events call methods" is I believe the phrase. So I tend to keep the code very tight in that event - grab the data, stuff it away somewhere, deal with it later. Works for me.

>PMFJI -
>
>yep, the MSCOMM32.OCX is a good way to go, but you don't really
>need the VFPCOM utility to bind events, because the MSCOMM32
>control already has an event that fires every time it receives
>a character. that event is the "OnComm" event. all you need
>to do is to react to that event on every received character
>and buffer (them) somewhere, and when your received character
>is CR and/or LF, send your entire buffer to the textbox, and
>clear the buffer. no need for any looping to check the MSCOMM32
>control status either, since the event fires asynchronously.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform