Re: Name of file that contains proc



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?
.



Relevant Pages

  • Re: File Copy Problem
    ... Andrew R. ... On command "Copy File", if first filename contains ... : Çakın Akçor ...
    (microsoft.public.fox.vfp.forms)
  • Re: How do I copy a file using xp_cmdshell
    ... I switched to a different account and now it works fine. ... > command) have access to this share? ... > Andrew J. Kelly SQL MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: C-Shell: How to append to filename?
    ... Andrew wrote: ... know how to rename each file in a directory by appending a _new to it. ... foreach filename ...
    (comp.unix.shell)
  • Re: Unique Name Generation
    ... Actually the filename will probably only be unique to the path 8-( ... Andrew J. Marshall ... MCP ...
    (microsoft.public.dotnet.languages.vb)
  • Re: double figure of day and month
    ... > Aaron Bertrand ... > SQL Server MVP ... > "Andrew" wrote in message ... >> I am going to use the date as my filename. ...
    (microsoft.public.inetserver.asp.general)