Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Createobject() and returning a parameter
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00047277
Message ID:
00047289
Views:
24
>Hi everybody!
>
>Can someone tell me, the correct way to return a value from a modal form, if the form was launched by the Createobject() command?
>
>Now, I give in a parameter the name of the variable, in which I want to get back the return value. I am cuoriuos, if there is a better way.
>
>TIA
>
>BB

You can use DO FORM form TO RetVar. In the .Unload of your form. RETURN RetVar

It may not necessarily be a better way, but this is how I go about these things.
I create a custom object in whose .Init I include .AddObject("oForm", "FormDef")
The custom object can have any number of methods created to manipulate the form and you can set any number of properties to act as return values. It always has this one method .ShowForm which contains; THIS.oForm.Show()

Within the form, various actions can set the properties of the custom object.
THISFORM.Parent.SomeProperty = ?? The point here is that you can set any number of properties within the custom object for use elsewhere.

Steve Despres
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform