Mark Wege wrote:
> I was wondering if anyone knows of a reliable method of obtaining the
> line of code being executed; specifically, I want to see how a proc was
> called from within that proc.
>
> I had hoped to use "info level" to get the information I need, but it
> shows the call after it has been parsed, by which time it has "lost" the
> information I need.
>
> I'm probably not explaining this well, so here's an example:
>
> set myVar var1
>
> set res [MyProc $myVar]
>
> From within the proc, the "info level" command will give me:
>
> MyProc var1
>
> but I need to obtain the original line of code, i.e.:
>
> set res [MyProc $myVar]
>
> Ultimately, what I'm need to know is that the result of the call to
> MyProc was stored in the variable "res", and I was hoping to be able to
> know this without modifying all calls to the procedure to pass the
> variable name in as a parameter (or storing it in a global variable).
Why would you need to know the name of the varaible you're returning
into? Couldn't you just return the value you want? Or do you want it to
act differently between:
set res [MyProc $myVar]
set ret [MyProc $myVar]
?
Received on Sun Apr 30 02:18:15 2006