P
PlusNet
Why doesn't the following work?
Dim MyStopwatch() as Stopwatch
...Later in the code
redim preserve MyStopwatch(10)
...Later in the code
MyStopwatch(1).start
The problem is that all the instances of MyStopwatch are set to nothing and
when I try doing anything to them it results in an error:
Object reference not set to an instance of an object
Normally of course you would specify 'New':
Dim Mystopwatch as new Stopwatch
But you can't do a 'New' with an array. The strange thing is that I don't
get the same error thrown when I do the same with all the other objects in
my program - just the Stopwatch.
-Jerry
Dim MyStopwatch() as Stopwatch
...Later in the code
redim preserve MyStopwatch(10)
...Later in the code
MyStopwatch(1).start
The problem is that all the instances of MyStopwatch are set to nothing and
when I try doing anything to them it results in an error:
Object reference not set to an instance of an object
Normally of course you would specify 'New':
Dim Mystopwatch as new Stopwatch
But you can't do a 'New' with an array. The strange thing is that I don't
get the same error thrown when I do the same with all the other objects in
my program - just the Stopwatch.
-Jerry