Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Property Not Accessible
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00674022
Message ID:
00674055
Vues:
20
Michael,

You should be able to do this already:

oVol = createobject("clsVolatility")
? oVol.oDate.Volatility

Since your class definition already does the ADD OBJECT.

If you want to add the other class on the fly you can do this:

oVol = createobject("clsVolatility")
oVol.AddObject( "oDate", "clsDateRange" )

? oVol.oDate.Volatility

>If a custom class definition holds a reference to another custom class (using the "ADD OBJECT" command), how can I set that object reference from outside the class? So...
>
>oVol = createobject("clsVolatility")
>oDate = Createobject("clsDateRange")
>oVol.DateRange = oDate && Not working.
>
>
>
>***************************************
>DEFINE CLASS clsVolatility AS CUSTOM
>***************************************
>
> Volatility = 0
>
> ADD OBJECT DateRange AS clsDateRange
>
>ENDDEFINE
>
>
>***************************************
>DEFINE CLASS clsDateRange AS CUSTOM
>***************************************
>
> StartDate = {}
> EndDate = {}
>
>ENDDEFINE
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform