Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Waiting until a form is closed form more execution
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00018079
Message ID:
00018195
Views:
42
>>OK, I have been doing this for awhile now, but just have not run into this before. My code is
>>Do FORM myform
>>DO Procedure
>>DO procedure 2
>>etc...
>>
>>The problem is, I want the program to wait till the first form is closed before executing the next lines of code. I have thought of a few ways to trap for it, but they do not seem to be the most straight forward way. I have looked over the help files, but don't see any mention of this. I can't beleive this is the first time I have had this problem.
>>The first form does critical file operations for the rest of the code to operate on.
>
>You need a READ EVENTS. So if you don't have it before DO FORM, it will not stop.

Read events is not the answer. You would need to clear events then and that would clear everything. events is not like the old 2.6 read, it isn't nested, its just there or not there.

You are searching for a way back to the old read model. Heres what I've found with similar problems. First try and rethink what you are doing. Is there another way to setup the form where this isn't needed? If not and you really need to violate the event model concept then you can do it.
Heres how

public m.looping
m.looping=.t.
do form myform.scx
do while m.looping
wait window '' timeout 1 (this cuts down on cpu usage)
loop
enddo

now in the unload event of myform change m.looping to .f.

In essence you're tricking the event model by trapping it in a loop.
Todd Burstain, MD
infinitydoc@delphi.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform