GEOS SDK TechDocs
|
|
4.3 Lists
|
4.5 Procedures
Each command produces two results: a code and a string . The code indicates whether the command completed successfully or not, and the string gives additional information. The valid codes are defined as follows:
Tcl programmers do not normally need to think about return codes, since TCL_OK is almost always returned. If anything else is returned by a command, then the Tcl interpreter immediately stops processing commands and returns to its caller. If there are several nested invocations of the Tcl interpreter in progress, then each nested command will usually return the error to its caller, until eventually the error is reported to the top-level application code. The application will then display the error message for the user.
In a few cases, some commands will handle certain "error" conditions themselves and not return them upwards. For example, the
for
command checks for the TCL_BREAK code; if it occurs, then
for
stops executing the body of the loop and returns TCL_OK to its caller. The
for
command also handles TCL_CONTINUE codes and the procedure interpreter handles TCL_RETURN codes. The
catch
command allows Tcl programs to catch errors and handle them without aborting command interpretation any further.
GEOS SDK TechDocs
|
|
4.3 Lists
|
4.5 Procedures