Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning a value from a class
Message
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00582724
Message ID:
00583236
Views:
27
I just realized that using private variable will make it even simplier
* textbox InterActiveChange 
PRIVATE ReturnValue
...
oClassPicker.Show(1) 
This.Value = ReturnValue

* VarPicker Unload
ReturnValue = Thisform.Listbox.Value
>Hi Peter,
>
>I'm not sure where the problem is but in this case it would be logical to pass an object as a parameter to the oClassPicker. Something like
>
>* textbox InterActiveChange
>loParam = Createobject("custom")
>loParam.Addproperty("ReturnValue", null)
>oClassPicker = Newobject("...", "..", "", loParam )
>oClassPicker.Show(1)
>This.Value = loParam.ReturnValue
>
>* VarPicker Init
>LPARAMETERS toParamObj
>This.oParamObj = toParamObj
>
>* VarPicker Unload
>This.oParamObj.ReturnValue = Thisform.Listbox.Value
>This.oParamObj = Null
>
>>
>>Thank you for taking an interrest.
>>
>>The problem seems to lie elsewhere. Since the debugger essentially behaves as if it's part of the application, everything works when in debug mode.
>>
>>So, I put in a Wait Window right after the oClassPicker.Show(1), and it looks like the class does not constitute a wait state, even though I set the form as Modal.
>>
>>What am I doing wrong here? Getting pretty desperate...
>>
>>TIA
>>
>>
>>>>Hi John,
>>>>
>>>>I saw your comment on this issue. I am trying to get a return value from a listbox on a form saved as class.
>>>>
>>>>Let's call the form VarPicker. In another form from the InterActiveChange in a Grid->Column->TextBox I issue a VarPicker.Show(1) and in the valid clause of VarPicker.ListBox I set the PickedVar property of VarPicker to the ListBox.Value.
>>>>
>>>>VarPicker.Hide and a This.Value=VarPicker.PickedVar still in the InterActiveChange method, and one would think that was it.
>>>>
>>>>It sort of works, 'cause it does something, basically it does it right every second time - which is rather unsatisfactory.
>>>
>>>Try to add NODEFAULT to the InterActiveChange event.
>>>
>>>>
>>>>What could be wrong- and how would I be able to apply your private var solution here?
>>>>
>>>>TIA
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform