[tcljava-user] constructor in Jacl scripts
Brought to you by:
mdejong
|
From: Vikram R. <Vi...@PL...> - 2001-07-26 12:10:25
|
hi,
A snippet from my Java program ...
Interp interp = new Interp();
String str = new String("this");
TclObject sTObject = ReflectObject.newInstance(interp, new
String().getClass(), str);
interp.setVar("value", null, sTObject, TCL.GLOBAL_ONLY);
interp.eval(script);
String s = (String)ReflectObject.get(interp, sTObject);
System.out.println("program output = " + s);
The script ....
set $value [java::new String "that"]
puts "script output = $value"
********* OUTPUT *********
script output = this
program output = this
The script does not change the value of the string variable. This seems to
happen every time I try to use the constructor to change the value of Java
object that is set as a interpreter variable.
What could be going wrong?
Vikram Rajan
|