Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating collection classes
Message
De
01/05/2001 12:17:53
Phillip Perkins
Technology Consulting, Inc.
Louisville, Kentucky, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00501934
Message ID:
00502022
Vues:
24
I wanted to do it that way, but how do I create a generic collection class of which I can reference the value of an item in that sense ( fields(n).value )? In your case, you create an object on an existing collection class. I want to build the class. I would much prefer the fields(n).value syntax, but I can't figure out how I would do that in VFP.

Just brainstorming here, but do you think that it would be possible to create an array of references to objects and then use the properties and methods of those individual objects by dereferencing through the array references?

For example:

DIMENSION myarray(10)
myarray(1) = CREATEOBJECT("Object1", "MyClass")
...

and then myarray(1).Value???

But then, how would I create a class that holds all the created objects and be able to reference them such as Parent.MyObjects(1).Value???

I think I've gone cross-eyed...

Phillip

>>Thanks for the help. I was trying to go about it the wrong way. Instead of fields(n).value, it should be fields.value(n). This makes more sense. Thanks for your help.
>>
>
>Is Fields(n).value a wrong way ?
>
>I posted on the file section (#1126) a collection sample using oRs.Fields("MyField").Value to access values.
>
>Marcel
"D'OH!" --Homer Simpson
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform