앞으로: Continuation Lines, 뒤로: The unwind_protect Statement, 위로: Statements [차례][찾아보기]
The original form of a try
block looks like this:
try body catch cleanup end_try_catch
where body and cleanup are both optional and may contain any Octave expressions or commands. The statements in cleanup are only executed if an error occurs in body.
No warnings or error messages are printed while body is executing.
If an error does occur during the execution of body, cleanup
can use the functions lasterr
or lasterror
to access the
text of the message that would have been printed, as well as its
identifier. The alternative form,
try body catch err cleanup end_try_catch
will automatically store the output of lasterror
in the structure
err. See Errors and Warnings, for more information about the
lasterr
and lasterror
functions.