Subj : Re: vector as return type in java function - access in jscript? To : netscape.public.mozilla.jseng From : Igor Bukanov Date : Wed Jan 28 2004 11:49 am Ulrich Staudinger wrote: > Igor. > >> >> 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 > > > Candle.toString() returns not an empty string ... it returns the content > of the candle (which is date, hi value, low, open and close) as a string. > >> c.getClose(): >> java.lang.System.out.println("function: "+c.getClose); >> and >> java.lang.System.out.println("property: "+c.close); >> > ------------------- New script: > function initialize(){ > var v=dbl.getTenMinuteCandles(10); > var c= new Packages.Candle(); > java.lang.System.out.println(c + " "+typeof c+" "+c.getClass()); > java.lang.System.out.println("function1: "+c.getClose); > 13: java.lang.System.out.println("property1: "+c.close); > 14: xp.sendChatMessage("uls@jabber.org", "initialize."+c.getClose()); > 15: var value=0.0; > java.lang.System.out.println("Size: "+v.size()); > for(i=0;i<1;i++){ > c=v.elementAt(i); > java.lang.System.out.println(c + " "+typeof c+" "+c.getClass()); > java.lang.System.out.println("function: "+c.getClose); > java.lang.System.out.println("property: "+c.close); > value+=c.getClose(); > } > xp.sendChatMessage("uls@jabber.org", "initialize."+value); > } > ------------------ > object class Candle > function1: undefined > property1: undefined > Evaluator(): TypeError: undefined is not a function. (<cmd>; line 14) From this I see that (new Candle()).toString() does return empty string and even the first invocation of getClose fails since Rhino can not locate getClose function. How is getClose declared in Java? Is it a public method? Regards, Igor .