Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning a value from a form
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00569550
Message ID:
00569952
Views:
17
Hi Jose,

Nothing is left in memory.

This works with MODAL forms only. If you want non-modal forms to somehow "talk" to the calling form, the calling form should pass a reference of itself to the called form (i.e. doform( "childForm", thisForm)), then the child form can access properties within the calling form. You will need to set up a parameter in the child form that allows it to keep that reference to the calling form.

Now, going back to modal forms, the following is copied from my web site and hopefully will help you understand how forms can return values in Mmortals.

Forms with return values (for REAL Mere Mortals)

There are some cases in which you would like to return a value from a form.

In order to do this, your form must be MODAL and instead of releasing it, you must HIDE it.

Also, you need to add to this form a property called uRetVal (if it doesn't exist already).

How it works

When doForm() starts, it creates a local variable called loObject.

Then an instance of your form is assigned to loObject. This effectively creates a local object (your form), and since this form is MODAL, doForm() stops temporarily after executing loObject.show(), which makes your form visible.

When you HIDE your form, doForm() continues with the next statement after the show(), which returns the value of your form's uRetVal property.

After doForm issues the RETURN, since your form was a local object, it is destroyed.


>Hi, I want to return a value from a form and I set ThisForm.uRetVal. I must hide the form? Is there any way to release the form? I don´t want to keep something in memory that will not be used again.
>
>Regards,
Low-carb diet not working? Try the Low-food diet instead!
Previous
Reply
Map
View

Click here to load this message in the networking platform