>>>To All:
>>>
>>>Is there an elegant way to wait for a modeless form to finish before the code continues? It's a top-level calling a top-level form. The called form does some calculations and returns (or sets) some values.
>>>
>>>I can think of a way by pausing execution, but wondered if there were others.
>>>
>>>TIA,
>>
>>First, why don't you uses a Desktop in-Top Modal ?
>>
>>Second, modeless Form is a async coding,
>>then callback is the master road:
>>
>>* run pre code
>>* create modeless top form
>>* set a wait callback event for topForm unload
>>* bindevent(topForm,"UnLoad",m.thisForm,"CallBack",1)
>>* don't forget to add a character to the topForm's Unload method
>>* put the rest of the code int othe thisform.Calback
>>
>>Of course it demands that not there are scope ties.
>
>
>Fabio,
>
>I didn't use the Desktop in-TopLevel Modal just because I like the appearance and flexibility of standalone windows. It could of course be done that way if necessary.
>
>I'm interested in your potential solution, let me see if I have this clearly:
>
>1) Bind the Unload event of the called Form to a method of the caller.
>2) Place the code that used to run immediately after the call into this method. As long as there are no timing issues, this should work.
>
>This is a good idea, I may try it. Thanks,
>
>-Irv.
Right,
Unload is a internal called method,
if it is empty, VFP don't call anything and the binded callback
is not called too.