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:
00668454
Views:
20
This message has been marked as a message which has helped to the initial question of the thread.
Hi Leroy.

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()


oMyState is an object reference to the form. What you need to do is, instead of releasing the oMyState form in the dblClick of the ListBox, just hide it. That way the calling form has access to all of the properties of the oMyState form. After the calling form gets what it needs (something like this):

lcMyState = oMyState.LstStates.Value

It can then release the oMyState form like this:

oMyState.Release()

Of course, if you want to be a bit more proper, just add a method to the oMyState form class called GetState and have the calling form call on that method to get the value of lcMyState instead of accessing the oMyState form class's properties directly.

HTH
Previous
Reply
Map
View

Click here to load this message in the networking platform