Re: [tcljava-user] Require some example on TclList
Brought to you by:
mdejong
From: shrisha k. <nav...@gm...> - 2007-05-05 17:25:42
|
Thanks for the reply and it was a good example. On 5/5/07, Mo DeJong <mo...@mo...> wrote: > > 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 > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > tcljava-user mailing list > tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcljava-user > |