diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2004-04-30 22:45:54 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2004-04-30 22:45:54 (GMT) |
commit | 996718aef341744dcfd658a3b81262bb2aa95bac (patch) | |
tree | 96053c7204b351ba999350bbd426b76a47550d15 /doc/incr.n | |
parent | f47d1b8393c44b34c977dd109e936dd41ab81031 (diff) | |
download | tcl-996718aef341744dcfd658a3b81262bb2aa95bac.zip tcl-996718aef341744dcfd658a3b81262bb2aa95bac.tar.gz tcl-996718aef341744dcfd658a3b81262bb2aa95bac.tar.bz2 |
More examples
Diffstat (limited to 'doc/incr.n')
-rw-r--r-- | doc/incr.n | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: incr.n,v 1.3 2000/09/07 14:27:48 poenitz Exp $ +'\" RCS: @(#) $Id: incr.n,v 1.4 2004/04/30 22:45:56 dkf Exp $ '\" .so man.macros .TH incr n "" Tcl "Tcl Built-In Commands" @@ -26,6 +26,29 @@ integer) is added to the value of variable \fIvarName\fR; otherwise 1 is added to \fIvarName\fR. The new value is stored as a decimal string in variable \fIvarName\fR and also returned as result. +.SH EXAMPLES +Add one to the contents of the variable \fIx\fR: +.CS +incr x +.CE + +Add 42 to the contents of the variable \fIx\fR: +.CS +incr x 42 +.CE + +Add the contents of the variable \fIy\fR to the contents of the +variable \fIx\fR: +.CS +incr x $y +.CE + +Add nothing at all to the variable \fIx\fR (often useful for checking +whether an argument to a procedure is actually numeric and generating +an error if it is not): +.CS +incr x 0 +.CE .SH "SEE ALSO" expr(n) |