Version 2 of info script

Updated 2004-03-10 11:07:30

info script ?filename?

If a Tcl script file is currently being evaluated (i.e. there is a call to Tcl_EvalFile active or there is an active invocation of the source command), then this command returns the name of the innermost file being processed. If filename is specified, then the return value of this command will be modified for the duration of the active invocation to return that name. This is useful in virtual file system applications.

Otherwise, if the file is not in the process of actively being sourced in or processed by Tcl_EvalFile, the command returns an empty string.

[So, what should one do if they need the name of the file in which a proc is located, in the case where the code is not actively being sourced?]


See also:


Category Command - Tcl syntax help