Let me preface by saying that I am new to programming, and my knowledge is spotty, so I'm not even sure what to call what it is that I'm trying to do:
dim myCollection as new Specialized.StringCollection
dim myFoundThings as new ArrayList
dim index as Integer
dim newResultMemberName as String
For Index = 0 To (myCollection.Count - 1)
If myCollection(Index) = "YouFoundMe" Then
newResultMemberName = myCollection(Index) & Index.ToString
' This is the part I'm not sure about - basic idea on following line:
' Dim <literal value of newResultMemberName> as New ThingFound(myCollection(index), Index)
myFoundThings.Add(<literal value of newResultMemberName>)
End If
Next Index
Public Class ThingFound
Public Sub New(ByVal contents As String, ByVal index As Integer)
' Assign constructors to ReadOnly Properties (I know how to do this part)
End Sub
End Class
This is part of some code that will run without user interaction once it's spinning away, and I need to create a unique object from some items found in a StringCollection, naming the objects using information found in the strings stored in that StringCollection.
Is this possible? Is this possible for a project targeted at .NET 2.0? Is there a better way to approach this problem?
Thanks in advance for any advice!
dim myCollection as new Specialized.StringCollection
dim myFoundThings as new ArrayList
dim index as Integer
dim newResultMemberName as String
For Index = 0 To (myCollection.Count - 1)
If myCollection(Index) = "YouFoundMe" Then
newResultMemberName = myCollection(Index) & Index.ToString
' This is the part I'm not sure about - basic idea on following line:
' Dim <literal value of newResultMemberName> as New ThingFound(myCollection(index), Index)
myFoundThings.Add(<literal value of newResultMemberName>)
Public Class ThingFound
Public Sub New(ByVal contents As String, ByVal index As Integer)
' Assign constructors to ReadOnly Properties (I know how to do this part)
This is part of some code that will run without user interaction once it's spinning away, and I need to create a unique object from some items found in a StringCollection, naming the objects using information found in the strings stored in that StringCollection.
Is this possible? Is this possible for a project targeted at .NET 2.0? Is there a better way to approach this problem?
Thanks in advance for any advice!