Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating collection classes
Message
 
To
01/05/2001 12:17:53
Phillip Perkins
Technology Consulting, Inc.
Louisville, Kentucky, United States
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00501934
Message ID:
00502170
Views:
29
Hi Phillip,

>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???
>

Yes It is

DIMENSION MyArray(1)

MyArray(1) = CREATEOBJECT("MyItem")
MyArray(1).value = "a"
? MyArray(1).value

DEFINE CLASS MyItem AS Custom

Value = .NULL.

ENDDEFINE

>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 am not sure I understand what you want but MyObjects(1).Parent.Value is possible with VFP

Marcel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform