This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

get procname

Old posts that have not been replied to for several years.
Locked
User avatar
sKy
Op
Posts: 194
Joined: Thu Apr 14, 2005 5:58 pm
Location: Germany

get procname

Post by sKy »

Is it possible to make a new command like

[procname]
which will return me the name of the actual proc.
like: set procname [procname]

I tryed to make such a proc which will return this while invoke a errormessage (and catch this) and then split $::errorInfo.
but i don`t get it to work.

Maybe there is an easyer way like a simple tcl command which i don`t know. please let me know ;)
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

why dont you use catch? you can get a detailed errorInfo like that:

if { [catch {procname params} err] } {
puthelp "NOTICE nick :$err"
putlog $errorInfo
}

err will contain the 1 line error from the proc, errorInfo will contain the multi-line trace back of the error with whole "invoked within on line x" thing. Both catch and errorInfo should contain the procname which caused the error.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
User avatar
ex
Voice
Posts: 14
Joined: Wed May 18, 2005 11:04 pm
Location: Chicago

Post by ex »

Code: Select all

set procname [lindex [info level 0] 0]
Locked