Bad example given in "Getting started"
Brought to you by:
mdejong
In "Evaluating a Tcl command from Java" the following code written:
interp.eval("string length \"" + thestr + "\"");
It is very bad because if thestr="str\";bad_command" will cause error 'invalid command name "bad_command"'.
The right code are the following:
interp.setVar("s", TclString.newInstance(thestr), 0);
interp.eval("string length $s");