Greetings,

I had a weird one last night w/ vtcl 1.10 over Linux (RH4.2).

I made a button and put a command in it, something like this:
"if {[check_proc "Check proc test string]} {
"       puts "check was ok, ent(asdf) is $ent(asdf)
")

When I tried to run the script, it gave me a compile error.

When I looked at the auto-generated code, I saw something like 
this:
"... \
"-command \n
"if\ {\[check_proc\ \"Check\ proc\ test\ string\]}\ \{\n
"\ \ \ \ puts\ \"check\ was\ ok,\ ent\(asdf\)\ is\ \$ent\(asdf\)\n
"\)\n\n

When I expected:
"... \
"-command {
"if {[check_proc "Check proc test string]} {
"       puts "check was ok, ent(asdf) is $ent(asdf)
")}

Note that the code that I put into the command was not enclosed by 
curly-braces by vtcl.

check_proc is defined and returns zero or one.  Now, the array, 
ent, is globally defined, and didn't seem to be the problem.  When 
I removed the reference to ent, the problems didn't go away.

Ultimately, I copied another button that was working and changed 
the code to match what I wanted and everything worked fine.

My question is, what went awry?  Is this a 'feature' that I can 
exploit in the future?

Just thought this was interesting and worth note.

--jim


---------------------------------------------------------------------------
To unsubscribe from the Visual Tcl mailing list, please send a message
to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
message body (where [EMAIL PROTECTED] is your e-mail address).

Reply via email to