diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2004-09-18 17:01:02 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2004-09-18 17:01:02 (GMT) |
commit | 5e5bcd132f05719b0bd2dbd8449cc26b325ef811 (patch) | |
tree | d0721a6b5b5206782155cb04dd3b28fd41bd8564 /doc/return.n | |
parent | 5c5d25ff6d6cf79ce06105cd339492f10e32aa82 (diff) | |
download | tcl-5e5bcd132f05719b0bd2dbd8449cc26b325ef811.zip tcl-5e5bcd132f05719b0bd2dbd8449cc26b325ef811.tar.gz tcl-5e5bcd132f05719b0bd2dbd8449cc26b325ef811.tar.bz2 |
More fixes from Mikhail Kolesnitchenko, and also standardize highlighting
of symbols like TCL_OK, TCL_ERROR, etc.
Diffstat (limited to 'doc/return.n')
-rw-r--r-- | doc/return.n | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/doc/return.n b/doc/return.n index 58c4bd1..c1c09b7 100644 --- a/doc/return.n +++ b/doc/return.n @@ -6,7 +6,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: return.n,v 1.9 2004/03/16 22:19:43 dgp Exp $ +'\" RCS: @(#) $Id: return.n,v 1.10 2004/09/18 17:01:06 dkf Exp $ '\" .so man.macros .TH return n 8.5 Tcl "Tcl Built-In Commands" @@ -51,26 +51,26 @@ exceptional return from the procedure. .TP 13 \fBok (or 0)\fR Normal return: same as if the option is omitted. The return code -of the procedure is 0 (TCL_OK). +of the procedure is 0 (\fBTCL_OK\fR). .TP 13 \fBerror (1)\fR -Error return: the return code of the procedure is 1 (TCL_ERROR). +Error return: the return code of the procedure is 1 (\fBTCL_ERROR\fR). The procedure command behaves in its calling context as if it were the command \fBerror \fIresult\fR. See below for additional options. .TP 13 \fBreturn (2)\fR -The return code of the procedure is 2 (TCL_RETURN). The +The return code of the procedure is 2 (\fBTCL_RETURN\fR). The procedure command behaves in its calling context as if it were the command \fBreturn\fR (with no arguments). .TP 13 \fBbreak (3)\fR -The return code of the procedure is 3 (TCL_BREAK). The +The return code of the procedure is 3 (\fBTCL_BREAK\fR). The procedure command behaves in its calling context as if it were the command \fBbreak\fR. .TP 13 \fBcontinue (4)\fR -The return code of the procedure is 4 (TCL_CONTINUE). The +The return code of the procedure is 4 (\fBTCL_CONTINUE\fR). The procedure command behaves in its calling context as if it were the command \fBcontinue\fR. .TP 13 @@ -108,7 +108,7 @@ recognized and treated specially by Tcl. They are: .TP \fB-errorcode \fIlist\fR The \fB-errorcode\fR option receives special treatment only when the value -of the \fB-code\fR option is TCL_ERROR. Then the \fIlist\fR value, which +of the \fB-code\fR option is \fBTCL_ERROR\fR. Then the \fIlist\fR value, which must be a valid Tcl list, is stored in the global variable \fBerrorCode\fR. The \fIlist\fR value is meant to be additional information about the error, presented as a Tcl list for further processing by programs. @@ -119,7 +119,7 @@ the global variable \fBerrorCode\fR to the default value of \fBNONE\fR. .TP \fB-errorinfo \fIinfo\fR The \fB-errorinfo\fR option receives special treatment only when the value -of the \fB-code\fR option is TCL_ERROR. Then \fIinfo\fR is the initial +of the \fB-code\fR option is \fBTCL_ERROR\fR. Then \fIinfo\fR is the initial stack trace, meant to provide to a human reader additional information about the context in which the error occurred. The stack trace will also be stored in the global variable \fBerrorInfo\fR. @@ -158,8 +158,8 @@ dictionary are treated as additional \fIoption value\fR pairs for the .PP Return codes are used in Tcl to control program flow. A Tcl script is a sequence of Tcl commands. So long as each command evaluation -returns a return code of TCL_OK, evaluation will continue to the next -command in the script. Any exceptional return code (non-TCL_OK) +returns a return code of \fBTCL_OK\fR, evaluation will continue to the next +command in the script. Any exceptional return code (non-\fBTCL_OK\fR) returned by a command evaluation causes the flow on to the next command to be interrupted. Script evaluation ceases, and the exceptional return code from the command becomes the return code @@ -175,7 +175,7 @@ codes to enable special features. For example, the built-in Tcl commands that provide loops -- such as \fBwhile\fR, \fBfor\fR, and \fBforeach\fR -- evaluate a script that is the body of the loop. If evaluation of the loop body returns the return code -of TCL_BREAK or TCL_CONTINUE, the loop command can react in such +of \fBTCL_BREAK\fR or \fBTCL_CONTINUE\fR, the loop command can react in such a way as to give the \fBbreak\fR and \fBcontinue\fR commands their documented interpretation in loops. .PP @@ -183,19 +183,19 @@ their documented interpretation in loops. Procedure invocation also involves evaluation of a script, the body of the procedure. Procedure invocation provides special treatment when evaluation of the procedure body returns the return code -TCL_RETURN. In that circumstance, the \fB-level\fR entry in the +\fBTCL_RETURN\fR. In that circumstance, the \fB-level\fR entry in the return options dictionary is decremented. If after decrementing, the value of the \fB-level\fR entry is 0, then the value of the \fB-code\fR entry becomes the return code of the procedure. If after decrementing, the value of the \fB-level\fR entry is greater than zero, then the return code of the procedure is -TCL_RETURN. If the procedure invocation occurred during the +\fBTCL_RETURN\fR. If the procedure invocation occurred during the evaluation of the body of another procedure, the process will repeat itself up the call stack, decrementing the value of the \fB-level\fR entry at each level, so that the \fIcode\fR will be the return code of the current command \fIlevel\fR levels up the call stack. The \fBsource\fR command performs the -same handling of the TCL_RETURN return code, which explains +same handling of the \fBTCL_RETURN\fR return code, which explains the similarity of \fBreturn\fR invocation during a \fBsource\fR to \fBreturn\fR invocation within a procedure. .PP @@ -203,10 +203,10 @@ The return code of the \fBreturn\fR command itself triggers this special handling by procedure invocation. If \fBreturn\fR is provided the option \fB-level 0\fR, then the return code of the \fBreturn\fR command itself will be the value \fIcode\fR -of the \fB-code\fR option (or TCL_OK by default). Any other value +of the \fB-code\fR option (or \fBTCL_OK\fR by default). Any other value for the \fB-level\fR option (including the default value of 1) will cause the return code of the \fBreturn\fR command itself -to be TCL_RETURN, triggering a return from the enclosing procedure. +to be \fBTCL_RETURN\fR, triggering a return from the enclosing procedure. .VE 8.5 .SH EXAMPLES |