On Mon, 24 Apr 2023 01:32:18 -0000 (UTC), Rich wrote:
Luc <[email protected]d> wrote:
puts "_string is $_string"
$argW delete "insert -$_lastWordSize c" insert
$argW insert insert $_string
The output of puts:
# ==============================================\n\n
What is inserted into the text widget:
# ==============================================\\n\\n
Why?
Too little info provided -- and code that does not run -- for us to
tell much.
The actual code is too large and spread across multiple files to be
posted here, but those three lines really are in that exact sequence.
Then try posting an actual small working sample here. The code you
have posted does not run (three variables are undefined -- and we are
not told their contents). And the code is 100% dependent upon the
contents of those variables, esp. the _string variable.
And your annotations are also incorrect, because the puts in the code
shown above would output something like "_string is blah" not "# =====...\n\n".
Most likely the contents of _string is not what you think it is at the
time your delete and insert's are actually called.
I know that the string is {# ==============================================\n\n}
I know because it is part of an array, I have a [parray] command in the
code, I found the relevant key and confirmed the exact string, there is
also a [puts $array(key)] command that prints the one string instead of
the entire array, and there is a [set _string $array(key)] command just
a moment before those three lines I provided. The [puts] line confirms
that the content is copied to the $_string variable correctly.
And your annotations are also incorrect, because the puts in the code
Yes, I wrote it from memory instead of copy-pasting it so it is indeed incorrect, but just assume I wrote
"_string is # ==============================================\n\n"
The code sequence is the one I posted. There is no way the content
of the $_string variable could be changed between the first and the
third line.
--
Luc
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)