Re: Name of file that contains proc
- From: SM Ryan <wyrmwif@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 16 Aug 2007 20:59:19 -0000
Andrew <hashmir@xxxxxxxxx> wrote:
# On Aug 16, 3:28 pm, "Gerald W. Lester" <Gerald.Les...@xxxxxxx> wrote:
# > 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|
# > +------------------------------------------------------------------------+
#
# Yes, I believe you are referring to this post: "Determining name/paths
# of source-d files at runtime," which I indeed read but found that the
# response to the author was pretty much "it's not possible." I see
# there is some other workaround "Only if you overload the source
# command with your own version," but being a newbie I have no idea what
# this means, nor is it explained in the thread at all. Any advice?
My secret wish is for the Tcl parser to recognise embedded #line directives
and report those and/or the current line counts.
--
SM Ryan http://www.rawbw.com/~wyrmwif/
Who's leading this mob?
.
- References:
- Re: Name of file that contains proc
- From: Andrew
- Re: Name of file that contains proc
- Prev by Date: Re: Name of file that contains proc
- Next by Date: Re: Question about loading a DLL
- Previous by thread: Re: Name of file that contains proc
- Next by thread: Re: Name of file that contains proc
- Index(es):
Relevant Pages
|