Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Array Type in Collection
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Array Type in Collection
Divers
Thread ID:
01299120
Message ID:
01299120
Vues:
44
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 
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform