<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 49: Bad example given in "Getting started"</title><link href="https://sourceforge.net/p/tcljava/bugs/49/" rel="alternate"/><link href="https://sourceforge.net/p/tcljava/bugs/49/feed.atom" rel="self"/><id>https://sourceforge.net/p/tcljava/bugs/49/</id><updated>2008-11-05T14:14:08Z</updated><subtitle>Recent changes to 49: Bad example given in "Getting started"</subtitle><entry><title>Bad example given in "Getting started"</title><link href="https://sourceforge.net/p/tcljava/bugs/49/" rel="alternate"/><published>2008-11-05T14:14:08Z</published><updated>2008-11-05T14:14:08Z</updated><author><name>Alexander Galanin</name><uri>https://sourceforge.net/u/agalanin/</uri></author><id>https://sourceforge.net2b959e1e76dcb934663a4c312daacf3ebeb11ee0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;In "Evaluating a Tcl command from Java" the following code written:&lt;/p&gt;
&lt;p&gt;interp.eval("string length \"" + thestr + "\"");&lt;/p&gt;
&lt;p&gt;It is very bad because if thestr="str\";bad_command" will cause error 'invalid command name "bad_command"'.&lt;/p&gt;
&lt;p&gt;The right code are the following:&lt;/p&gt;
&lt;p&gt;interp.setVar("s", TclString.newInstance(thestr), 0);&lt;br /&gt;
interp.eval("string length $s");&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>