Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I suspend one form to run another? 1

Status
Not open for further replies.

sjpatrick

Programmer
Sep 4, 2001
54
US
On my main project form, I have a button that opens another form to get input from the user to determine where it goes next. Specifically, what page on a pageframe and which pages will be available.
My calling button has this code:

public waithere
waithere=.t.
thisform.lockscreen=.t.
do form pmenu2001
*do while waithere
*enddo
release waithere
thisform.lockscreen=.f.

And the pmenu2001 form changes the public waithere to .f. when done.
The actual behavior is that both forms freeze.
Remming out the two lines as shown prevents the lockup, but does not behave the way I want.

How can I make one form wait for another before continuing?
Thanks for any suggestions.
 
Did you make your second form MODAL?

Set the form's WindowType property to 1 - Modal.
Set it's ShowWindow property to 2 - As Top Level Form.

Dave S.
 
Thanks Jim, but I guess I should have included more information. The form is modal, as such it works perfectly as a child form to the runtime.
I am running all of these as top-level forms outside of the runtime window.
 
Since the called form is modal, the user can't access the calling form. What other sort of processing do you need to "suspend"?

Jim
 
HI Patrick,

The calling form can be modal an the called form can also be modal. In this case, the called form will wait to get released and then the called form gets back to top. So there is nothing wrong in that.

But the code..
DO WHILE waithere && .t.
ENDDO
statement... will freeze the computer.. since this is an endless loop which will never exit. There is nothing to make 'do while .t. ' to .f. within the loop. This statement is wrong without doing a processing within that loop.

If your intention is to get some value back from the called second modal form, either you should have a public variable to collect that value, (made public in the calling form).. or use the command..
DO FORM pMenu2001 TO myVariable
based on the myVariable, you can jump to which ever page you want or whatever to do.

Hope the concept helps you :) ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top