/* * ReturnCmd.java -- * * This file implements the Tcl "return" command. * * Copyright (c) 1997 Cornell University. * Copyright (c) 1997 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and * redistribution of this file, and for a DISCLAIMER OF ALL * WARRANTIES. * * RCS: @(#) $Id: ReturnCmd.java,v 1.1.1.1 1998/10/14 21:09:19 cvsadmin Exp $ * */ package tcl.lang; /* * This class implements the built-in "return" command in Tcl. */ class ReturnCmd implements Command { /* *---------------------------------------------------------------------- * * cmdProc -- * * This procedure is invoked as part of the Command interface to * process the "return" Tcl command. See the user documentation * for details on what it does. * * Results: * None. * * Side effects: * See the user documentation. * *---------------------------------------------------------------------- */ public void cmdProc( Interp interp, // Current interpreter. TclObject argv[]) // Argument list. throws TclException // A standard Tcl exception. { interp.errorCode = null; interp.errorInfo = null; int returnCode, i; /* * Note: returnCode is the value given by the -code option. Don't * confuse this value with the compCode variable of the * TclException thrown by this method, which is always TCL.RETURN. */ returnCode = TCL.OK; for (i=1; i