Tool Command Language: 4.6 Syntax and Structure: Variables

Up: GEOS SDK TechDocs | Up | Prev: 4.5 Procedures | Next: 5 Commands

Tcl allows the definition of variables and the use of their values either through $-style variable substitution, the var command, or a few other mechanisms. Variables need not be declared: a new variable will automatically be created each time a new variable name is used. Variables may be either global or local. If a variable name is used when a procedure is not being executed, then it automatically refers to a global invocation of the procedure. Local variables are deleted whenever a procedure exits. The global command may be used to request that a name refer to a global variable for the duration of the current procedure (somewhat analogous to extern in C).


Up: GEOS SDK TechDocs | Up | Prev: 4.5 Procedures | Next: 5 Commands