Ein Kollege hatte ein größeres Makro in VBScript geschrieben und ein interessantes Problem dabei entdeckt. Ich mache mal ein Ratespiel daraus ;)

Was ist faul mit diesem VBScript-Code?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
On Error Resume Next
If MyFunction() Then
    MsgBox "MyFunction succedded"
Else
    MsgBox "MyFunction failed"
End If
 
MsgBox "... continue execution ..."
 
Function MyFunction
    MsgBox "Start MyFunction"
    On Error Goto 0
...
    MsgBox "End MyFunction"
    Test = true
End Function