Skip to content
Tcl Source Code Artifact [722e2aa3be]
Login

Artifact [722e2aa3be]

Artifact 722e2aa3be875068a828e1a54b2914db40911af1c840f34e5694a079ceccce1e:



title: Introduction TclVersion: 9.1 Links:

About this manual

This is the manual of the Tcl language and the Tk toolkit. It describes every command available in Tcl/Tk. The manual pages are divided into sections:

The basic 12 syntax rules of Tcl ("the Dodecalogue") are defined on the page Language syntax.

Syntax notation

A Tcl/Tk command consists of words where each word is a text string separated by white space from other words. Newlines separate commands (not words).

The first word of a command is called the "command name". The second word of a command, if it is a literal word (see below) is called the subcommand. All other words are called arguments in general. Specific terms are used when an argument serves a specific purpose or is handled in a specific way.

In the manual pages, it looks like this:

::: {.synopsis} ::: [commandName]{.cmd} [subCommand]{.sub} [argument]{.arg} [commandName]{.cmd} [argument]{.arg} :::

Arguments come in two flavours, mandatory arguments and optional arguments:

[boldText]{.lit} : Denotes a literal word, to be written in the command as is.

[italicText]{.arg} : Denotes an argument. That is a word which is mandatory but with a variable content, i.e. things you must fill in. The text in the syntax description is just a placeholder for your input and its name often tells you what is expected here.

[option]{.optarg} : Text enclosed in a pair of '?' denotes options. These are optional arguments, i.e. words that can be omitted in the command.

[arg]{.optdot} : Means that the previous options may be repeated any number of times (including zero times). Every word within the enclosed pair of '?' must be repeated in the same order, not just some of them. E.g., [item value]{.optdot} means any number of pairs (including zero) such as item1 value1 item2 value2 item3 value3