<sh********@yahoo.comwrote in message
news:11*********************@r34g2000hsd.googlegro ups.com...
I'm sure I'm just missing something here but is there a way to nest
objects inside an object or a collection that functions like an object
with properties BESIDES creating whole classes or making public
variables?
Private Sub Click()
Dim x as SomeSortOfCollection
msg box(x.Name & " " & x.Phone)
End Sub
Private Function Person() as SomeSortOfCollection
Dim Name as String= "John"
Dim Phone as String = "888-888-8888"
Person.Add(Name)
Person.Add(Phone)
End Function
What I'm not looking for:
Anything using a for each method
Using a key value like SomeObject("Name").value
You can use a strong type collection of objects. You can load the collection
with the objects.
You can create a function/method within the collection object to search for
object based on the value looking for and either stop on the object and
address the object or have the object returned from the collection so that
you can address its values.
You can use a for each loop in the function/method within the collection.
The one object call it NamePhone would contain property Let and Get for the
Name and Phone properties, and one NamePhone object is loaded into the
collection for each NamePhone object populated.