Re: Embedded interpreter woes?
Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de> writes:
> 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"
> ;
Yes,
first I was wondering that I had some end-of-line issues (\r versus \n)
so I did put the tcl-program into a file that I then did read at runtime and
whoop: the program did what expected. And I was confused as content of the
file then really was exactly the same as I had in my memory buffer, including
end-of-line marks.
--
Antti J$(D??(Brvinen, costello@iki.fi
"concerto for two faggots and orchestra"
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