Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating collection classes
Message
 
 
À
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:
00502115
Vues:
15
Phillip,

You question got me thinking... I have an application called DataDictionary. It has a program called ModifyStructure. The code in this program is quite complicated and not quite efficient. I just got an idea: create an object (say, based on line for simplicity), add two custom properties: aTableFields and aTableIndexes. Now, in my program I can instantiate two objects and make comparisions in the table structure with what I have in DataDict/IndxDict table.
The code would be now much simpler, than I currently have.

>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.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform