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!

question about scope of bgerror (override)

Status
Not open for further replies.

smugindividual

Programmer
Apr 14, 2003
104
US
I have overriden bgerror in a .tcl file. All tcl errors that occur in that file hit the override properly. The same .tcl file calls functions from numerous .htk files. Tcl errors that occur in these files never hit the override. To me, this looks correct. My coworker believes that the override in the .tcl file should encompass the whole application. Can anyone shed light on this for me or point me in the direction of some documentation, not man pages please.
 
Just a thougth: if the .htk files use catch you'll never get your bgerror proc executed.

HTH

ulis
 
Catches arent being used in the portions i am looking at. The errors are being seen, just not in the overriden bgerror. Getting the regular tcl dialog with "ok skip details" buttons on the bottom. I guess maybe the question should have been:

Does an overriden "built-in function" adhere to the same scope rules as regular functions?



Maybe I'm looking for someone to say that because its a built-in function that it doesnt get called the same way that user defined functions are called.
 
OK just found something else that might be helpful.

I included [namespace which -command bgerror] at two places in my application to see if I could figure out what is going on. Once in the .tcl file where the override is and once in a function in a separate file. The overriden bgerror produced ::bgerror meaning bgerror is defined at the global scope. The other produced a NULL, not an error like you would see with an undefined proc. This all leads me to believe that in the world of tcl/tk there is a more powerful scope than global. Thoughts, ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top