| Дзюндзя ( @ 2007-07-17 16:17:00 |
| Entry tags: | code, vb6, Праграмізм |
Funny bug
You would think that "next line" after the condition that raises an error would be the line after "End If", not the one right after "Then"...
On Error Resume Next
Dim c As Collection
'comment out to show the bug
'Set c = New Collection
'c.Add "Shit"
'since c wasn't initialized, accessing it's property raises an error
'you'd think that Resume Next will go to the line after End If, but...
If c.Count > 0 Then
MsgBox "Shit happened"
End If