I have written a user defined class in LotusScript.
Now in the constructor of this class is an error handler which will be executed when an error occures during constructor execution. Now, is it possible that if in an error case in the constructor it can set its whole object to nothing?
What I want is that when define an object from this class, I can test the object if it is nothing or not to be sure the construction was successful.
Here is what I mean:
Sub New
On Error GoTo ErrorHandler
'Some code which might cause an error
Terminate:
Exit Sub
ErrorHandler:
'Here is where I want to set the whole object, which this constructor should create, to nothing.
Resume Terminate
End Sub
Now unfortunately I see no way in achiving my goal that a failing constructor sets the whole object to nothing in the calling code.
Does anybody have an idea?