tclgetvar
Retrieve the value of a Tcl variable as a string.
Syntax
tclgetvar(varname, index)
Argument
- varname
- A string.
- index
- A string (optional).
Example
To use the Tcl interpreter to add two numbers and then
set a Templex variable to the result:
Templex Expression | Results |
---|---|
{ mypath = tclgetvar("env", "PATH")
}
|
"/usr/local/bin " |
Comments
This function can be used to retrieve information from Tcl routines, which can be invoked via tcleval or tclevalfile. The second parameter is optional and is used as an array index into varname.