Re: Name of file that contains proc



Andrew wrote:
Hello all,

I'm wondering how to get the filename of the file that contains the
procedure, when I run the procedure. For example, if I have file
functions.tcl that contains this proc my_name, like so:

===functions.tcl===
proc my_name { } {
puts ?????;
}
===============


Then if I go run tclsh, source functions.tcl, and run my_name, it
should displays "functions.tcl". I tried global argv0, that gives me
the name of the executable, [info script] gives me nothing (it works
if I don't put it in the proc), and of course [info nameofexecutable]
gives me /usr/bin/tclsh. Any help would be appreciated!

This same question was posted in the last two weeks. You may want to google for that thread and read it.


--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
.



Relevant Pages

  • Name of file that contains proc
    ... I'm wondering how to get the filename of the file that contains the ... functions.tcl that contains this proc my_name, ... I tried global argv0, that gives me ... [info script] gives me nothing (it works ...
    (comp.lang.tcl)
  • Re: transaction isolation level
    ... SET options will revert back to the original settings once the ... SQL Server MVP ... > Andrew J. Kelly SQL MVP ... >> will that count for every Select..From statement in the proc? ...
    (microsoft.public.sqlserver.programming)
  • Re: transaction isolation level
    ... SET options within a stored procedure only are in effect for the execution ... SQL Server MVP ... > Andrew J. Kelly SQL MVP ... >> will that count for every Select..From statement in the proc? ...
    (microsoft.public.sqlserver.programming)
  • Re: Image viewing - a different approach
    ... proc launch::file {filename} { ... kind of shortcut, as every Windows user has his desktop filled with. ... proc link {path filename} { ...
    (comp.lang.tcl)
  • Re: Bundling images and libraries with TclApp
    ... But I can't acess the file in right PATH, I try -file [file join ... make sure that the use of [info script] is done at script-level ... code (not in a proc). ...
    (comp.lang.tcl)

Loading