home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / tcl_447.lzh / TCL / tcl.lzh / tcl / help / results < prev    next >
Text File  |  1990-05-03  |  2KB  |  57 lines

  1. COMMAND RESULTS
  2.  
  3.    Each command produces two results:  a code and a string.
  4.    The code indicates whether the command completed
  5.    successfully or not, and the string gives additional
  6.    information. The valid codes are defined in tcl.h, and are:
  7.  
  8.         TCL_OK     This is the normal return code, and
  9.        indicates that the command
  10.        completed succesfully.  The string
  11.        gives the command's return value.
  12.  
  13.         TCL_ERROR    Indicates that an error occurred;
  14.        the string gives a message
  15.        describing the error.  The variable
  16.        errorInfo will contain additional
  17.        information describing which 
  18.        commands and procedures were being
  19.        executed when the error occurred.
  20.  
  21.         TCL_RETURN    Indicates that the return command
  22.        has been invoked, and that the
  23.        current procedure (or top-level
  24.        command or source command) should
  25.        return immediately. The string
  26.        gives the return value for the
  27.        procedure or command.
  28.  
  29.         TCL_BREAK    Indicates that the break command
  30.        has been invoked, so the innermost
  31.        loop should abort immediately.  The
  32.        string should always be empty.
  33.  
  34.         TCL_CONTINUE    Indicates that the continue command
  35.        has been invoked, so the innermost
  36.        loop should go on to the next
  37.        iteration.  The string should
  38.        always be empty.
  39.  
  40.    caller.  If there are several nested invocations of the Tcl
  41.    interpreter in progress, then each nested command will
  42.    usually return the error to its caller, until eventually the
  43.    error is reported to the top-level application code. The
  44.    application will then display the error message for the
  45.    user.
  46.  
  47.    In a few cases, some commands will handle certain ``error''
  48.    conditions themselves and not return them upwards.  For
  49.    example, the for command checks for the TCL_BREAK code;  if
  50.    it occurs, then for stops executing the body of the loop and
  51.    returns TCL_OK to its caller.  The for command also handles
  52.    TCL_CONTINUE codes and the procedure interpreter handles
  53.    TCL_RETURN codes.  The catch command allows Tcl programs to
  54.    catch errors and handle them without aborting command
  55.    interpretation any further.
  56.  
  57.