If number is positive (> 0) then it selects a particular stack level (1 refers to the top-most active command, i.e., info frame itself, 2 to the command it was called from, and so on); otherwise it gives a level relative to the current command (0 refers to the current command, i.e., info frame itself, -1 to its caller, and so on).
This is similar to how info level works, except that this subcommand reports all frames, like source'd scripts, eval's, uplevel's, etc.
Note that for nested commands, like "foo [[bar [[x]]]]" only "x" will be seen by an info frame invoked within "x". This is the same as for info level and error stack traces.
The result dictionary may contain the keys listed below, with the specified meanings for their values:
In contrast, a procedure definition or eval within a dynamically evaluated environment count linenumbers relative to the start of their script, even if they would be able to count relative to the start of the outer dynamic script. That type of number usually makes more sense.
A different way of describing this behaviour is that file based locations are tracked as deeply as possible, and where this is not possible the lines are counted based on the smallest possible eval or procedure body, as that scope is usually easier to find than any dynamic outer scope.
The syntactic form {expand} is handled like eval. I.e. if it is given a literal list argument the system tracks the linenumber within the list words as well, and otherwise all linenumbers are counted relative to the start of each word (smallest scope)
proc printProc {procName} { set result [list proc $procName] set formals {} foreach var [info args $procName] { if {[info default $procName $var def]} { lappend formals [list $var $def] } else { # Still need the list-quoting because variable # names may properly contain spaces. lappend formals [list $var] } } puts [lappend result $formals [info body $procName]] }
Copyright © 1993 The Regents of the University of California. Copyright © 1994-1997 Sun Microsystems, Inc. Copyright © 1993-1997 Bell Labs Innovations for Lucent Technologies Copyright © 1998-2000 Ajuba Solutions Copyright © 1995-1997 Roger E. Critchlow Jr.