Contents Previous Next Subchapters

Posting a Dialog With an Error Message
Syntax errordlg(msg)
errordlg(
msgcallback)
errordlg(
msgtopicfile)
See Also adddialog

Description
Posts an error dialog and then halts the currently executing O-Matrix program. This routine never returns and execution will only resume after the user chooses one of the buttons in the dialog. In addition, all currently open files are closed, and the currently set error trap is cleared. The error message contained in the character matrix msg is included in the error dialog together with a push button labeled "Ok". When the user chooses "Ok", the error dialog is dismissed. If the character row vector callback is present, it specifies a call back command that is executed after the error dialog is dismissed. If the character row vectors topic and file are present, a push button labeled "Help" is included in the dialog. If the user chooses "Help", the help function is called with the corresponding topic and file as arguments.

Easydlg
This routine uses the easydlg function which is documented in its own winhelp file (see File | Help | Easydlg).

Example
If you enter
     function DeepCall(arg1, arg2, arg3) begin
          narg = arg(0)
          if narg <> 3 then begin
               msg = ["Only ", ntoa(narg), " arguments to DeepCall"]
               errordlg(msg)
          end
          print arg1, arg2, arg3
     end
     DeepCall("One", "Two")
O-Matrix will abort execution before the statement
     print arg1, arg2, arg3
and post an error dialog with the message
     Only 2 arguments to DeepCall