1incr(n)                      Tcl Built-In Commands                     incr(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       incr - Increment the value of a variable
9

SYNOPSIS

11       incr varName ?increment?
12_________________________________________________________________
13
14

DESCRIPTION

16       Increments the value stored in the variable whose name is varName.  The
17       value of the variable must be an integer.   If  increment  is  supplied
18       then  its  value  (which  must  be an integer) is added to the value of
19       variable varName;  otherwise 1 is added to varName.  The new  value  is
20       stored  as  a  decimal  string in variable varName and also returned as
21       result.
22

EXAMPLES

24       Add one to the contents of the variable x:
25              incr x
26
27       Add 42 to the contents of the variable x:
28              incr x 42
29
30       Add the contents of the variable y to the contents of the variable x:
31              incr x $y
32
33       Add nothing at all to the variable x (often useful for checking whether
34       an  argument to a procedure is actually numeric and generating an error
35       if it is not):
36              incr x 0
37
38

SEE ALSO

40       expr(n)
41
42

KEYWORDS

44       add, increment, variable, value
45
46
47
48Tcl                                                                    incr(n)
Impressum