| 1 |
'\" |
| 2 |
'\" Copyright (c) 1989-1993 The Regents of the University of California. |
| 3 |
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. |
| 4 |
'\" |
| 5 |
'\" See the file "license.terms" for information on usage and redistribution |
| 6 |
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 7 |
'\" |
| 8 |
.TH Tcl_AllowExceptions 3 7.4 Tcl "Tcl Library Procedures" |
| 9 |
.so man.macros |
| 10 |
.BS |
| 11 |
.SH NAME |
| 12 |
Tcl_AllowExceptions \- allow all exceptions in next script evaluation |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
\fB#include <tcl.h>\fR |
| 16 |
.sp |
| 17 |
\fBTcl_AllowExceptions\fR(\fIinterp\fR) |
| 18 |
.SH ARGUMENTS |
| 19 |
.AS Tcl_Interp *interp |
| 20 |
.AP Tcl_Interp *interp in |
| 21 |
Interpreter in which script will be evaluated. |
| 22 |
.BE |
| 23 |
|
| 24 |
.SH DESCRIPTION |
| 25 |
.PP |
| 26 |
If a script is evaluated at top-level (i.e. no other scripts are |
| 27 |
pending evaluation when the script is invoked), and if the script |
| 28 |
terminates with a completion code other than \fBTCL_OK\fR, \fBTCL_ERROR\fR |
| 29 |
or \fBTCL_RETURN\fR, then Tcl normally converts this into a \fBTCL_ERROR\fR |
| 30 |
return with an appropriate message. The particular script |
| 31 |
evaluation procedures of Tcl that act in the manner are |
| 32 |
\fBTcl_EvalObjEx\fR, \fBTcl_EvalObjv\fR, \fBTcl_Eval\fR, \fBTcl_EvalEx\fR, |
| 33 |
\fBTcl_GlobalEval\fR, \fBTcl_GlobalEvalObj\fR, \fBTcl_VarEval\fR and |
| 34 |
\fBTcl_VarEvalVA\fR. |
| 35 |
.PP |
| 36 |
However, if \fBTcl_AllowExceptions\fR is invoked immediately before |
| 37 |
calling one of those a procedures, then arbitrary completion |
| 38 |
codes are permitted from the script, and they are returned without |
| 39 |
modification. |
| 40 |
This is useful in cases where the caller can deal with exceptions |
| 41 |
such as \fBTCL_BREAK\fR or \fBTCL_CONTINUE\fR in a meaningful way. |
| 42 |
|
| 43 |
.SH KEYWORDS |
| 44 |
continue, break, exception, interpreter |