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:
00047879
Views:
30
Hi Barbara!

My problem was, that if I pass a variable by reference to a form, the Init method is the only place, where I change the parameter, the the calling variable is changing to. But If I store the variable to a property, and later I change this property, the original calling variable wouldnot change.

BB

>Bela, in the INIT store the variable to a form property which you have designed for this purpose. You can store an array or an object (like a form reference) to a form property exactly as you would store a character or numeric variable. The only thing to remember is for array properties you have to set the property as an array in the first place and then use acopy() to store your variable to the form array property.
>
>HTH
>Barbara
>
>>Hi Jim!
>>
>>But how to change this variable in other methods than Init?
>>
>>TIA
>>
>>BB
>>
>>>>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
>>>Bela,
>>>
>>>Be sure you are passing that parameter by reference as in;
>>>
>>> loObj = CreateObject("MyFormClass",@MyVar)
>>>
>>>This way whatever the form does to MyVar is actually happening to the copy of MyVar in the calling code.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform