01: /*
02: * TestEvalObjvCmd.java --
03: *
04: * |>Description.<|
05: *
06: * Copyright (c) 1997 by Sun Microsystems, Inc.
07: *
08: * See the file "license.terms" for information on usage and redistribution
09: * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
10: *
11: * RCS: @(#) $Id: TestEvalObjvCmd.java,v 1.3 2005/10/29 00:27:43 mdejong Exp $
12: */
13: package tcl.lang;
14:
15: public class TestEvalObjvCmd implements Command {
16:
17: /*
18: *----------------------------------------------------------------------
19: *
20: * TestevalobjvObjCmd -> cmdProc
21: *
22: * This procedure implements the "testevalobjv" command. It is
23: * used to test Tcl_EvalObjv.
24: *
25: * Results:
26: * A standard Tcl result.
27: *
28: * Side effects:
29: * None.
30: *
31: *----------------------------------------------------------------------
32: */
33:
34: public void cmdProc(Interp interp, // Current interpreter.
35: TclObject[] objv) // The argument objects.
36: throws TclException {
37: boolean evalGlobal;
38: TclObject[] newObjv;
39:
40: if (objv.length < 3) {
41: throw new TclNumArgsException(interp, 1, objv,
42: "global word ?word ...?");
43: }
44: evalGlobal = (TclInteger.get(interp, objv[1]) != 0);
45: newObjv = new TclObject[objv.length - 2];
46: System.arraycopy(objv, 2, newObjv, 0, objv.length - 2);
47: Parser.evalObjv(interp, newObjv, -1,
48: ((evalGlobal) ? TCL.EVAL_GLOBAL : 0));
49: }
50: } // end TestEvalObjvCmd
|