Subj : Re: vector as return type in java function - access in jscript? To : Ulrich Staudinger From : Igor Bukanov Date : Wed Jan 28 2004 10:34 am Ulrich Staudinger wrote: ..... >>> ---------------------- jscript: >>> 10: function initialize(){ >>> 11: var v=dbl.getTenMinuteCandles(10); >>> 12: var c= new Packages.Candle(); >>> 13: xp.sendChatMessage("uls@jabber.org", "initialize."+c.getClose()); >>> 14: var value=0.0; >>> 15: for(i=0;i<10;i++){ >>> 16: c=v.elementAt(i); >>> 17: >>> 18: >>> 19: value+=c.getClose(); >>> 20: } >>> 21: xp.sendChatMessage("uls@jabber.org", "initialize."+value); >>> 22: } >>> ------------- >>> ..... >> >> Are you sure that v contains instances of Candle? Try to add something >> like java.lang.System.out.println(c + " "+typeof c+" "+c.getClass()) >> after the line 16. >> > Added what you suggested, output in console is: 'object class Candle'. > TypeError is still there. The output is fine assuming that Candle.toString() in Java returns empty string. Could you add then this output after line 12 and add in addition before each call of c.getClose(): java.lang.System.out.println("function: "+c.getClose); and java.lang.System.out.println("property: "+c.close); Also you may try to use a recent CVS tip build, see http://www.mozilla.org/rhino/download.html Regards, Igor .