Re: Tcl bug?
- From: Ken Tilton <kentilton@xxxxxxxxx>
- Date: Mon, 15 May 2006 16:04:40 -0400
Donald Arseneau wrote:
Ken Tilton <kentilton@xxxxxxxxx> writes:
proc TraceOP {n1 n2 op} {event generate $n1 <<tracewrite>> -data {$n1 $op}}
trace add variable .f44.ent45 write TraceOP
Error: Tcl error: can't read ".f44.ent45": no such variable
Don't use braces for -data! You are preventing $n1 $op from
being substituted in the context of TraceOP.
Really? I thought I saw that working. maybe not since the last upheaval. Thx.
proc TraceOP {n1 n2 op} {event generate $n1 <<tracewrite>> -data [list $n1 $op]}
By the way, you can get really misleading error messages from
traces. The error message and the error context (errot_info)
don't seem to correspond.
What happened was that the event handler that picked up the <<tracewrite>> event was curious about the new value so it did:
Tcl_Eval("set .f44.ent55")
I guess since the trace command had triggered the callback, a procedure was running and so the scope was local. Game over. :)
I simply have not finished the transition from pipespeak to using the C api, or I would have found Tcl_GetVar sooner, along with the flags i could use to make the scope global.
thx for the info.
kt
--
Cells: http://common-lisp.net/project/cells/
"Have you ever been in a relationship?"
Attorney for Mary Winkler, confessed killer of her
minister husband, when asked if the couple had
marital problems.
.
- Follow-Ups:
- Re: Tcl bug?
- From: Donald Arseneau
- Re: Tcl bug?
- References:
- Tcl bug?
- From: Ken Tilton
- Re: Tcl bug?
- From: Donald Arseneau
- Tcl bug?
- Prev by Date: Re: hi
- Next by Date: Re: Tcl crashes when running "spawn telnet <IP_Addr>"
- Previous by thread: Re: Tcl bug?
- Next by thread: Re: Tcl bug?
- Index(es):
Relevant Pages
|
Loading