Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ending a do while loop
Message
From
03/03/1997 10:31:13
Narendra Lilaramani
Gentech Business Machines Ltd
Ahmedabad, India
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00022590
Message ID:
00022652
Views:
40
>>>Deal All,
>
>>>
>
>>>I am designing a form with a listbox and two command bottons, one
>
>>>for starting a loop of measurement, the other for interrupting the
>
>>>measurement.
>
>>>
>
>>>When the button of starting measurement, a do loop is the activated,
>
>>>and continue reading signal from rs232 port. outputing the signal to
>
>>>the listbox. The other botton is used for ending the loop. What I hope
>
>>>is no matter I press ESC key or the botton, the loop will be stopped.
>
>>>
>
>>>
>
>>>
>
>>>
>
>>>
>
>>>The program I wrote as follows,
>
>>>=======
>
>>>*** When command button cmbtStartMeasure is clicked, starting measuring
>
>>>action
>
>>>

Hi Ron

As I understand your application you need event driven reading
from the port, not in a loop so other objects (ie commandbutton
or Esc key) can be responded.

I think you might need to change yr code as folows :

1. Instead of reading Serial port in a loop (Polling mode), Read
in interrupt mode. ie Set Rthreshold property of MSCOMM, so
whenever a char is available OnComm event will be fired &
you can read it in OnComm event.
In this method yr comand button as well as Esc key will work
because no Loop is executing.

Hope this will solve yr problem.

Narendra
Previous
Reply
Map
View

Click here to load this message in the networking platform