![]() |
![]()
| ![]() |
![]()
NAMEscope - capture the namespace context for a variable SYNOPSISitcl::scope name DESCRIPTIONCreates a scoped value for the specified name, which must be a variable name. If the name is an instance variable, then the scope command returns a string of the following form: @itcl object varName If the name is not an instance variable, then it must be a common variable or a global variable. In that case, the scope command returns the fully qualified name of the variable, e.g., ::foo::bar::x. If the name is not recognized as a variable, the scope command returns an error. Ordinary variable names refer to variables in the global namespace. A scoped value captures a variable name together with its namespace context in a way that allows it to be referenced properly later. It is needed, for example, to wrap up variable names when a Tk widget is used within a namespace: namespace foo { You should never use the @itcl syntax directly. For example, it is a bad idea to write code like this: set {@itcl ::fred x} 3 puts "value = ${@itcl ::fred x}" KEYWORDScode, namespace, variable
|