Beispiel #1
0
 static TclObject getArrayElts(
     Interp interp, // Current interpreter.
     Object arrayObj, // Array to dereference. Must be an array.
     Class arrayClass, // Class object of array to deref
     int index, // First elt to dereference.
     int count, // Number of elts to dereference.
     boolean convert) // Whether the values should be converted
     // into Tcl objects of the closest types.
     throws TclException // May encounter bad index.
     {
   TclObject resultListObj = TclList.newInstance();
   try {
     for (int i = 0; i < count; i++, index++) {
       TclList.append(
           interp, resultListObj, getArrayElt(interp, arrayObj, arrayClass, index, convert));
     }
   } catch (TclException e) {
     resultListObj.release();
     throw e;
   }
   return resultListObj;
 }