Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Collections not possible in session classes why
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01008791
Message ID:
01009840
Vues:
30
Sure you can add a collection property to a Session based class but you've to do it differently.
oColSession = cREATEOBJECT("ClassSession")
oColSession.func1()
? oColSession.oColl(1)
*---------------------------------------------------------
DEFINE CLASS ClassSession as session
	oColl = Null
	FUNCTION Init
		This.oColl = CREATEOBJECT("Collection")
	ENDFUNC
	FUNCTION func1
		this.oColl.Add("Zal")
	ENDFUNC
ENDDEFINE
>Yes, I want to create a collection property in a class. Using a custom based class it works,but a session based class fails: "Object Class is invalid for this container" See the following:
>
>
>oColClass = CREATEOBJECT("ClassCustom")
>oColSession = cREATEOBJECT("ClassSession")
>
>DEFINE CLASS ClassCustom as Custom
>ADD OBJECT oColl as collection   && I want to create a collection property
>                                 && is this the way?
>FUNCTION func1
>this.oColl.Add("Zal")
>ENDFUNC
>
>ENDDEFINE
>
>
>DEFINE CLASS ClassSession as session
>ADD OBJECT oColl as collection   && I want to create a collection property,is this the way? DOESN'T WORK	
>
>FUNCTION func1
>this.oColl.Add("Zal")
>ENDFUNC
>
>ENDDEFINE
>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform