Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining what PROC i'm in

Status
Not open for further replies.

johnlopez2000

Programmer
Aug 2, 2002
90
US
for purposes of abstracting my error/warning messages, I need something like

set x [info myProgName]
set y [info myProcName]

to determine the program name that is being executed, and the proc in which the interpreter launches the message:

err "[info myProgName] - [info myProcName]: my error msg"

I've looked at "info" and "tclvars" to no avail

thanks - (probably something obvious)

John Lopez
Enterprise PDM Architect
lopez.john@goodrich.com
 
And info script will give you the name of the currently executing script file. Note that if one Tcl script sources another, an info script command in the sourced script will give its file name, not that of the sourcing script. If you want the name of the originally launched script file, that's the value of the pre-defined global argv0 variable. (By the way, if you simply launch an interactive Tcl interpreter, argv0 will report the name of the interpreter, rather than any script file you happen to source in that interactive session.)

- Ken Jones, President, ken@avia-training.com
Avia Training and Consulting, 866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top