Re: [tcljava-user] Require some example on TclList
Brought to you by:
mdejong
From: Mo D. <mo...@mo...> - 2007-05-04 19:59:26
|
shrisha karanth wrote: > Hello all, > > I require some example of TclList, > > My Problem is that i want to send arrayList to the TCL from java.so i > wanto to know how to intiliaze tcllist and append values into it. > > Thanks > Naveen > Hello Naveen Here is the most simple example of TclList usage: { TclObject alist = TclList.newInstance(); TclList.append(interp, alist, TclString.newInstance("ONE")); TclList.append(interp, alist, TclString.newInstance("TWO")); TclList.append(interp, alist, TclString.newInstance("THREE")); interp.setResult(alist); } To get values out of a ArrayList, just iterate over the elements and create a TclString or TclInteger object for each element before adding to the TclList. I hope that helps Mo DeJong |