- Scilab help
- Scilab keywords
Please note that the recommended version of Scilab is 2023.1.0. This page might be outdated.
However, this page did not exist in the previous stable version.
errcatch(n [,'action'] [,'option']) errcatch()
- action, option
errcatch gives an "action" (error-handler) to be
performed when an error of type
n has the following meaning:
n is the error number to trap
n<0 all errors are to be trapped
action is one of the following character strings:
a pause is executed when trapping the error. This option is useful for debugging purposes. Use
whereami()to get information on the current context.
next instruction in the function or exec files is executed, current instruction is ignored. It is possible to check if an error has occured using the
iserrorfunction. Do not forget to clear the error using the
errclearfunction as soon as possible This option is useful for error recovery. In many cases, usage of
errcatch(n,"continue",..)can be replaced by the use of execstr function or try control structure.
default mode, all intermediate functions are killed, scilab goes back to the level 0 prompt.
interrupts the current Scilab session (useful when Scilab is called from an external program).
option is the character string
'nomessage' for killing
To set back default mode, enter
errcatch(-1,"kill") or similarly
errcatch() is an obsolete equivalent of
errcatch actions apply to the current evalution
context (function, exec, pause ) and all the sub-levels. A second
errcatch call in a sub-level hides the initial one for
this sub-level. If a second
errcatch call is made at the
same level, the effect of the first one is removed.
When called in the context of a Scilab function or exec the
errcatch is automatically
reset when the function returns.
|<< edit||Scilab||errclear >>|