Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How Do I Return a Value From An Object
Message
 
À
18/06/2003 09:00:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00800953
Message ID:
00801138
Vues:
18
David,

It seems your object is a form. One way to realize your goal is to use a parameter object.
loParm = CreateObject("MyParmClass")

loForm = CreateObject("MyFormObject",loParm)
loForm.Show()

...

somevalue = loParm.SomeProperty
loParm = NULL
MyParmClass would be a class defined with the property SomeProperty added to it (the base class is irrelavent). You recieve the parm object in the form's init and save a reference to it in a form property (which you have added to the form class for that purpose).
* Form's Init
LPARAMETERS poParm
This.oParm = poParm
Then from within the form you can refer to the parm object as Thisform.oParm.SomeProperty.

The big advantage of using this technique is that you are virtually unlimited on how many properties the parm object can have. Some can be values being passed into the form and others values returned by the form. Some of the properties of the parm object can even be arrays full of values.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform