B
Bugs
Does anyone have any recommendations on the best way to create multiple
instances of the same class when the final number of instances is unknown?
For example, I have a class and based on some user actions, I want to
create n number instances of those classes, which is obviously unknown
at compile time.
What is the easiest way to create and then manage these kinds of objects?
Using an array seems intuitive but it also seems like it might be more
difficult to manage if you want to add and delete objects.
Would it be best to maybe create a collection of the objects? If so,
how would I name those objects before adding them to the collection. Is
it possible to name an object instance based on a string literal? e.g.
Public Sub createMyNewClass(ByVal myStringLiteral as String)
Dim myStringLiteral As New myNewClass(myStringLiteral)
Except somehow the value of myStringLiteral is used as the object name,
not the name "myStringLiteral"?
Thanks!
instances of the same class when the final number of instances is unknown?
For example, I have a class and based on some user actions, I want to
create n number instances of those classes, which is obviously unknown
at compile time.
What is the easiest way to create and then manage these kinds of objects?
Using an array seems intuitive but it also seems like it might be more
difficult to manage if you want to add and delete objects.
Would it be best to maybe create a collection of the objects? If so,
how would I name those objects before adding them to the collection. Is
it possible to name an object instance based on a string literal? e.g.
Public Sub createMyNewClass(ByVal myStringLiteral as String)
Dim myStringLiteral As New myNewClass(myStringLiteral)
Except somehow the value of myStringLiteral is used as the object name,
not the name "myStringLiteral"?
Thanks!