Introduction To Tcl

From OpenSeesWiki
Revision as of 22:22, 1 April 2010 by Fmk (talk | contribs) (Created page with '{{CommandManualMenu}} Tcl is a string-based command language with relatively little syntax. Tcl scripts are made up of commands separated by new lines or semicolon (;). The bas...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search




Tcl is a string-based command language with relatively little syntax. Tcl scripts are made up of commands separated by new lines or semicolon (;). The basic syntax for a Tcl command is:

command arg1 arg2 arg3 ...
command is name of the command
$arg1 $arg2 $arg3 ... are the arguments for the command

The command is either the name of a built-in command or a Tcl procedure defined previously by the user. White space (i.e., space or tab) is used to separate the command name and its arguments, and a newline or semicolon is used to terminate a command. The arguments to a command are just strings.

Tcl has syntax for grouping, which allows multiple words in one argument, and substitution, which is used with programming variables and nested command calls. The Tcl interpreter does grouping first, then substitutions, and finally it calls the command. It is up to the command to interpret its arguments.