error prints an error message into the command window and terminates the execution of the running program.
Return Value
This function does not return to the function where the error function was called and therefore has no return value.
Parameters
ssMessage is a scalar string, which the function will print into the command window. If the message text consists of a single exclamation mark (!) or begins with an exclamation mark, an exception is created without displaying a message box.
Comment
The error function will create an exception.
Example
def read_text_file(ssFileName)
{
if (nargsin() == 0) {
error("missing filename")
}
fp = fopen(ssFileName, "r");
if (fp == 0) {
error("cant open " + ssFileName)
}
ssText = fread(fp, "char");
flose(fp);
return ssText;
}
See also
Overview Programming, GetExceptionCode, GetExceptionInfo, config
id-918964