Re: Getting proc to recognize all global variables
From: Glenn Jackman (xx087_at_freenet.carleton.ca)
Date: 02/12/04
- Next message: Donal K. Fellows: "Re: How to capture result from "ls" command?"
- Previous message: Bryan Oakley: "Re: How to capture result from "ls" command?"
- In reply to: David McClamrock: "Getting proc to recognize all global variables"
- Next in thread: Mark G. Saye: "Re: Getting proc to recognize all global variables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 12 Feb 2004 15:10:35 GMT
David McClamrock <mcclamrock@locl.net> wrote:
> Would somebody please remind me how (or whether) it's possible to get a proc
> to recognize all variables in the global scope, even if the variables
> aren't mentioned by name in the proc itself? If so, thanks in advance!
proc inGlobalScope {} {
uplevel #0 {
# this is the proc body
# with global vars
}
}
have some care about variables in different scopes though:
proc inglobal {x} {
puts $x
uplevel #0 {puts $x}
}
set x fred
inglobal joe
-- Glenn Jackman NCF Sysadmin glennj@ncf.ca
- Next message: Donal K. Fellows: "Re: How to capture result from "ls" command?"
- Previous message: Bryan Oakley: "Re: How to capture result from "ls" command?"
- In reply to: David McClamrock: "Getting proc to recognize all global variables"
- Next in thread: Mark G. Saye: "Re: Getting proc to recognize all global variables"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|