Joe, The DoEvents allows windows to process other events as well as allowing VFP to poll the keyboard etc. You can do no harm in your application sprinkling some DoEvents around, especially when you have a potentially long processing time in a loop etc or need to refresh the screen when any updating is being done.
To all intents and purposes and in simple terms the debugger allows other windows/vfp events to fire as you actually generate a wait state (the equivalent of DoEvents), whereas without it you can even go into a processing loop which will ignore disable the "hit ESC to abort" even if Set Secape is set to be ON. Glad it sorted out the problem anyway. Dave Crozier -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Joe Yoder Sent: 18 September 2007 17:38 To: [email protected] Subject: re: Killing time while waiting for a timer event Dave, It was the DoEvents that I needed. I'm new to VFP and had assumed that events get processed as they come. Do I need to sprinkle "DoEvents" throughout my code any time that events may occur? Thanks - Joe On Tuesday, September 18, 2007 12:03 PM, Dave Crozier wrote: > >Date: Tue, 18 Sep 2007 17:03:49 +0100 >From: Dave Crozier >To: [EMAIL PROTECTED] >Subject: RE: Killing time while waiting for a timer event > >Joe, >I assume you have two timers active then? > >1. Have you disabled the timer so that it cannot fire whilst the timer event >is active? I.e first command in Timer event -> This Enabled=.F. and the last >command This.Enabled=.T. before the return. > >2. Have you put in a DoEvents command in the Timer loop to make sure that >standard windows events are processed in the loop? > >Other than that, could use more information on the code you have in the >timer event(s) before offering suggestions. > >Dave Crozier > > >-----Original Message----- >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf >Of Joe Yoder >Sent: 18 September 2007 16:42 >To: [email protected] >Subject: Killing time while waiting for a timer event > >I have a simple program where I send a command to a device and setup a timer >to write "DONE" to a form property when 100 milliseconds have elapsed. The >program then sits in a loop waiting until the the form property changes to >"DONE" before proceeding to process the results. > >When I run the code the program hangs in the loop permanently. When I step >through with the debugger everything seems to work properly. When I put a >wait window inside the wait loop, the program exits the loop properly. > >There is obviously something I don't understand. Can someone help? > >TIA - Joe Yoder > > >--- StripMime Report -- processed MIME parts --- >multipart/alternative > text/plain (text body -- kept) > text/html >--- > [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

