Re: Embedded interpreter woes?
Hi Antti,
costello@iki.fi (Antti J$(D??(Brvinen) 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
Fnews-brouse 1.9(20180406) -- by Mizuno, MWE <mwe@ccsf.jp>
GnuPG Key ID = ECC8A735
GnuPG Key fingerprint = 9BE6 B9E9 55A5 A499 CD51 946E 9BDC 7870 ECC8 A735