<< switch | Interpreter functions | while >> |
try, statements_1, catch, statements_2, end |
try, statements_1, catch exception, statements_2, end |
try and catch statements are used for error handling and control in files.
exception is an MException object that allows you to identify the error.
The catch block assigns the current exception object to the variable in exception.
try/catch in a script file
try
error('an error')
catch
disp('error catched')
end
try/catch in a script file
try
error('an error')
catch ME
ME
end
run, execstr, MException.
Version | Description |
---|---|
1.0.0 | initial version |
Allan CORNET