Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Self-closing modal form that returns a value
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Self-closing modal form that returns a value
Miscellaneous
Thread ID:
00778051
Message ID:
00778051
Views:
67
Hi all,

I'd like to call a modal form, do some processing (and display results), then have it close itself and return a value. I'm not quite sure how to make a form close itself and successfully return a value.

I tried this:

Init()

thisform.nRetVal = mycode() && my processing
return .f. && to close it

Unload()
return thisform.nRetVal


This fails to return the value for some reason, even though I can step through the Unload() and see the correct value in thisform.nRetVal. It seems to have something to do with the return .f. in the init().

If instead of the code in the Init(), I put a cmdButton on the form and do this

cmdButton.click()
thisform.nRetVal = mycode()
thisform.release()

It works fine. The thisform.nRetVal shows up in the calling form. But I don't want the user to have to do anything, like clicking a button. I just want the form to open, do stuff, close, and return a value (it is actually running some Dynazip functions and displaying Dz status).

TIA,
Larry Tucker
Next
Reply
Map
View

Click here to load this message in the networking platform