Aharon Grupman
Aharon Grupman

Reputation: 11

Parent TCL procedure

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

Answers (1)

TrojanName
TrojanName

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

Related Questions