Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating collection classes
Message
De
01/05/2001 14:22:52
Phillip Perkins
Technology Consulting, Inc.
Louisville, Kentucky, États-Unis
 
 
À
01/05/2001 12:47:22
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:
00502143
Vues:
18
Whoops!!! Forgot one line in my sample code.
myform.thing[1] = myform.text1
This will store a reference to the object in that array index.

Phillip

>Aha!!! Just figured it out. For those of you that want a simple solution to my problem (at least the ground work), the way that I solved this was to create a class (custom, container, whatever) and add an array property (class.thing[1]). Then, add objects to your class like crazy (run-time is what I'm going for). When you add these objects, redimension your array property and point that property to your object.
>
>Here's the deal ( I chose to use a form with a textbox collection in this example ):
>
>myform = CREATEOBJECT("Form")
>myform.AddProperty("thing[1]", NULL)
>myform.AddObject("text1", "textbox")
>myform.text1.Value = "Whatever"
>? myform.thing[1].value
>
>Should print "Whatever" to active area (SCREEN).
>
>>Use the examples given in my previous post, these are generic collection classes and do exactly what you want. You may have to subscribe to FoxTalk but the VFUG one is free.
"D'OH!" --Homer Simpson
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform