简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM