```basic
Code: Select all
Dim oDialog1
Sub StartDialog1
BasicLibraries.LoadLibrary("Tools")
oDialog1 = Tools.LoadDialog("Standard", "HelloDlg")
oDialog1.Execute()
End Sub
Sub ExitDialog
oDialog1.endExecute()
End Sub
But when using `ExitDialog` event handler I get an error that my `oDialog1` object variable is not set. What's wrong?