01: /*
02: * TestcompcodeCmd.java --
03: *
04: * This command is loaded into a test version of Tcl Blend and Jacl
05: * to perform regression tests to test the handling of completion
06: * code.
07: *
08: * Copyright (c) 1997 Sun Microsystems, Inc.
09: *
10: * See the file "license.terms" for information on usage and
11: * redistribution of this file, and for a DISCLAIMER OF ALL
12: * WARRANTIES.
13: *
14: * RCS: @(#) $Id: TestcompcodeCmd.java,v 1.1 1999/05/10 04:09:00 dejong Exp $
15: *
16: */
17:
18: package tcl.lang;
19:
20: class TestcompcodeCmd implements Command {
21:
22: /*
23: *----------------------------------------------------------------------
24: *
25: * cmdProc --
26: *
27: * Returns the given completion code and result.
28: *
29: * Results:
30: * None.
31: *
32: * Side effects:
33: * The interp's result object is changed to argv[2].
34: *
35: *----------------------------------------------------------------------
36: */
37:
38: public void cmdProc(Interp interp, // Current interpreter.
39: TclObject argv[]) // Argument list.
40: throws TclException // Standard Tcl exception.
41: {
42: if (argv.length != 3) {
43: throw new TclNumArgsException(interp, 1, argv,
44: "code result");
45: }
46: int code = TclInteger.get(interp, argv[1]);
47: interp.setResult(argv[2]);
48: throw new TclException(code);
49: }
50:
51: } // end TestcompcodeCmd
|