R
Raterus
I know this may seem like a silly question, but I can't figure it out!
I've made my own object, which has five properties. When I instantiate this object, the new constructor is passed these values. I need to create a dynamic array of these objects, and I don't know how many could be created.
Basically I want to do this (which doesn't work..) "TemplateSearch" is my object
....
Private search() As TemplateSearch
Private searchCount As Integer = 0
For each blah in myBlahs
search(searchCount) = new TemplateSearch(f1, f2, f3, f4, f5)
searchCount = searchCount + 1
Next
....
I get the dreadful "Object reference not set to an instance of an object.",
I know I can put a number when I declare my object, "Private search(100) as TemplateSearch", but that seems like a cop-out, and if I ever insert more than this number, it'll break. Can someone help me out on this?
Thanks!
--Michael
I've made my own object, which has five properties. When I instantiate this object, the new constructor is passed these values. I need to create a dynamic array of these objects, and I don't know how many could be created.
Basically I want to do this (which doesn't work..) "TemplateSearch" is my object
....
Private search() As TemplateSearch
Private searchCount As Integer = 0
For each blah in myBlahs
search(searchCount) = new TemplateSearch(f1, f2, f3, f4, f5)
searchCount = searchCount + 1
Next
....
I get the dreadful "Object reference not set to an instance of an object.",
I know I can put a number when I declare my object, "Private search(100) as TemplateSearch", but that seems like a cop-out, and if I ever insert more than this number, it'll break. Can someone help me out on this?
Thanks!
--Michael