Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Array Type in Collection
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Array Type in Collection
Miscellaneous
Thread ID:
01299120
Message ID:
01299120
Views:
43
Is there a way to access an array as an array within an object once you stick it into a collection?

The function alen() fails when I use it on an array property within an object that is added to a collection object. The code below shows the scenario. The first messagebox shows that the type of aList is "C". When I try to access the aList of the object inside the collection, I get type "U". I must be missing something....

Thanks in advance...

George Scapin
mybox = CREATEOBJECT("obox")
myball1=CREATEOBJECT("oball", "1 inch", "blue/white", "hard")
mybox.addball(myball1)

DEFINE CLASS oball as Custom
	PROCEDURE init
		LPARAMETERS cSize, cColor, cHardness
		this.AddProperty('aList(1)')
		DIMENSION this.alist[3,2]
		this.alist[1,1] = "SIZE"
		this.alist[1,2] = cSize
		this.alist[2,1] = "COLOR"
		this.alist[2,2] = cColor
		this.alist[3,1] = "HARDNESS"						
		this.alist[3,2] = cHardness
	ENDPROC 
	
ENDDEFINE 

DEFINE CLASS obox as Collection 
	PROCEDURE addball
		LPARAMETERS toIn
		MESSAGEBOX(TYPE("toIn.alist",1))
		this.Add(toIn)
		MESSAGEBOX(TYPE("mybox(1).alist",1))
	ENDPROC 
ENDDEFINE 
Next
Reply
Map
View

Click here to load this message in the networking platform