HLRosenberger
asked on
collection and data type
Isn't there a way to declare a collection to hold a certain data type? What the syntax?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hey
read this link
http://visualbasic.about.com/od/learnvbnet/a/LVBE_L8_3.htm
you can try generic types also, check this
http://msdn.microsoft.com/en-us/library/w256ka79(v=vs.80).aspx
read this link
http://visualbasic.about.com/od/learnvbnet/a/LVBE_L8_3.htm
you can try generic types also, check this
http://msdn.microsoft.com/en-us/library/w256ka79(v=vs.80).aspx
As mentioned by first comment above use a generic list, look at it as type safe collection:
Dim list As New List(Of String)
'Add items
list.Add("test 0")
' index access
Dim entry As String = list(0)
'Insert at index, be aware that index < count.
list.Insert(0,"test 0000")
Check:
http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx
http://www.vbdotnetheaven.com/UploadFile/Saurabh.Mishra/GenericsInCsharp211232006000706AM/GenericsInCsharp2.aspx
Dim list As New List(Of String)
'Add items
list.Add("test 0")
' index access
Dim entry As String = list(0)
'Insert at index, be aware that index < count.
list.Insert(0,"test 0000")
Check:
http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx
http://www.vbdotnetheaven.com/UploadFile/Saurabh.Mishra/GenericsInCsharp211232006000706AM/GenericsInCsharp2.aspx
ASKER
Thanks
ASKER