Path: ccsf.homeunix.org!ccsf.homeunix.org!news1.wakwak.com!nf1.xephion.ne.jp!onion.ish.org!onodera-news!newsfeed.media.kyoto-u.ac.jp!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.arcor-online.net!easynews.net!newsfeed3.easynews.net!newsfeed.vmunix.org!newspeer1-gui.server.ntli.net!ntli.net!sn-xit-02!sn-xit-04!sn-xit-01!sn-post-01!supernews.com!news.supernews.com!seneca.benny.turtle-trading.net!nobody From: Benjamin Riefenstahl Newsgroups: comp.lang.tcl,fr.comp.lang.tcl,han.comp.lang.tcltk,fj.comp.lang.tcl Subject: Re: Embedded interpreter woes? Date: Sat, 15 Nov 2003 21:06:02 +0100 Organization: None Message-ID: References: User-Agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:vmP43fOn0W1PY7IEptaDdx4IdOM= MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@supernews.com Lines: 20 Xref: ccsf.homeunix.org fj.comp.lang.tcl:6 Hi Antti, costello@iki.fi (Antti Järvinen) writes: > char *the_program = "puts stdout $FooBar\nset a_len [ string length > $FooBar ]\nputs stdout $a_len" ; > [...] > printf("\neval=%d\n",Tcl_Eval(tcl_interp, the_program)) ; With older Tcl versions, the actual programs that are passed to Tcl_Eval() must be in modifiable memory (the code temporarily sets characters to 0). Try this variable declaration instead: static char the_program[] = "puts stdout $FooBar\n" "set a_len [ string length $FooBar ]\n" "puts stdout $a_len\n" ; benny