Reputation: 11
let's say you have a TCL procedure ProcA and a TCL script ScrpB. ProcA sources ScrpB. How can I know, from within ScrpB, that ProcA sourced it?
Thank you
I tried the folowing. From within ScrpB called to "info frame" and did get any usefule info.
Upvotes: 1
Views: 123
Reputation: 5365
info level 0
is specifically what you are looking for. You can browse the entire calling stack by adding something like this in the called proc:
for {set i [info level]} {$i > 0} {set i [expr {$i - 1}]} {
lappend stack [info level $i]
}
return $stack
Upvotes: 3