I use OnError to automatically detect that var1 was unset and then give it a value of "hey".
But I still need the script to actually show a messagebox with "hey". Instead, the script proceeds to the next line, msgbox "box2". So no messagebox "hey" was shown.
I understand that this is the intended behaviour of OnError, but is there a way to repeat msgbox var1 anyway?
Code: Select all
myfunc()
myfunc()
{
static var1
OnError ErrFuncObj
msgbox var1
msgbox "box2"
ErrFuncObj(ErrorObj, Mode)
{
if ErrorObj is UnsetError
{
msgbox "UnsetError yo"
var1 := "hey"
}
else
{
throw ErrorObj
}
return -1
}
}