01: /*
02: * ListLengthCmd.java --
03: *
04: * This file tests changing an argument object's internal
05: * rep to TclList.
06: *
07: * Copyright (c) 2002 by Mo DeJong
08: *
09: * See the file "license.terms" for information on usage and redistribution
10: * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
11: *
12: * RCS: @(#) $Id: ListLengthCmd.java,v 1.1 2002/12/18 03:39:54 mdejong Exp $
13: */
14:
15: package tests;
16:
17: import tcl.lang.*;
18:
19: public class ListLengthCmd implements Command {
20: public void cmdProc(Interp interp, TclObject[] objv)
21: throws TclException {
22: if (objv.length != 2) {
23: throw new TclNumArgsException(interp, 1, objv, "obj");
24: }
25: interp.setResult(TclList.getLength(interp, objv[1]));
26: return;
27: }
28: }
|