Contents Previous Next Subchapters

Using the Standard O-Matrix Error Dialog
Syntax error(msg)
error(msgtopic)
See Also usage , halt , errortrap , errordlg , help

Description
Posts the standard O-Matrix error dialog and then halts the currently executing O-Matrix program.

msg
is a matrix that specifies an error message that is included in the error dialog. This is the beginning of the actual error message. It is either an empty matrix or it must be a character matrix. If all the character in msg are white space characters, the error routine returns without posting the error dialog. Otherwise O-Matrix execution is halted and error never returns to the routine that called it.

topic
If the Help button in the error dialog is selected, the file specified by the character row vector topic in the directory c:\omwin\htm is displayed in your web browser. This file specification does not include the extension of the file which must be .htm. If the specified file is not present in the c:\omwin\htm directory, the file c:\omwin\htm\index.htm is displayed. If topic is not present, the file c:\omwin\htm\contents.htm is displayed which corresponds to topic being equal to "contents".

Example
If you enter
     error("Error in call to sin", "sin")
O-Matrix will display an error dialog with an error message and the first line of the error message will be
     Error in call to sin
If you then select the Help button in the error dialog, O-Matrix will display the file c:\omwin\htm\sin.htm in your default web browser.

Reference
The message specified by msg is just the beginning of the error message posted in the error dialog. Other information, such as the corresponding source code location where the call to error was made, is included in the error dialog. The routine errordlg does not include this extra information.

You can use the errortrap routine to trap calls to the error function just like error messages that are generated by the O-Matrix system. Note that the first rowdim(msg) rows of the message passed to the error trapping routine will contain the message specified by msg. Also not that if the file specified by topic is not present, the topic passed to the error trapping routine is "index".

Mlmode
In Mlmode , this function can be accessed using the name usage as well as the name error. If in Mlmode you enter
     usage('Improver argument')
O-Matrix will display an error dialog with an error message and the first line of the message will be
     Improper argument