| Funny bug |
[Jul. 17th, 2007|04:17 pm] |
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
|
|
|
| Zen of Visual Basic |
[Mar. 18th, 2005|07:30 pm] |
Dim Everything As Object
If Everything Is Nothing Then
MsgBox "Everything Is Nothing"
End If
|
|
|