Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Collections not possible in session classes why
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01008791
Message ID:
01009840
Views:
31
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--
Previous
Reply
Map
View

Click here to load this message in the networking platform