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:
00668213
Message ID:
00668295
Views:
19
Leroy,

Your GetState form class needs to have its windowType property set to 1 (modal). Otherwise, the code after your show() will run, causing oMyState to go out of scope, which causes it to disappear :)

Make sure the GetState class has a property to store the return value. It might be better to call this property something different than value, to avoid confusion with individual controls. Of course, you from inside the form class itself you don't do a thisform.release(), but you set thisform.returnValue and then call thisform.hide().
oMyState = CreateObject("GetState")
oMyState.windowType = 1  && set to modal, you should do this inside of the class itself
                         &&    instead of here
oMyState.show()
lcMyState = oMyState.returnValue
release oMyState
* continue on your merry way
HTH...

>
>What I want to do is:
>
>oMyState = Createobject('GetState')
>oMyState.show()
>** some how catch what ever state is chosen.
>*** (the way the form works is that on double click, it grabs the state
>*** releases the form and returns the value to the textbox)
>
>*** theory code
>lcMystate = oMystate.value
>THIS.PARENT.RFI_TEXTBOX1.VALUE = ALLTRIM(lcMystate)
>THIS.PARENT.VALUE = ALLTRIM( lcMystate)
>THIS.PARENT.VALID()
>
>
>
>Of course when I try this it doesn't work. It will flash and I guess hides behind something.
>I can't get it to stay on top. I really wouldn't know how to return a value if I got it to stay on top. The property is marked to always be on top. But of course it doesn't do that.
>
< snip >
Steve Gibson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform