Hi, I had a procedure that included a Sleep(0) statement as a short pause in a loop that moved an Imageview around on screen.
I recently tried to add an "IF <condition> Then Exit" statement to this procedure so as to drop out of a Select Case statement, but I get an error message: "Object Reference not set to an instance of an object".
Why is this a problem ? Something to do with Resumable subs ? My code was of the following general form:
Select Case variable
I recently tried to add an "IF <condition> Then Exit" statement to this procedure so as to drop out of a Select Case statement, but I get an error message: "Object Reference not set to an instance of an object".
Why is this a problem ? Something to do with Resumable subs ? My code was of the following general form:
Select Case variable
Case
Case
Case Else
End SelectCase
some code
If <condition> THEN EXIT <<< Adding this line generates the error
more code
If <condition> THEN EXIT <<< Adding this line generates the error
more code
For ... To ...
'move Imageview
Sleep(0) <<< Removing this line removes the error
NextSleep(0) <<< Removing this line removes the error