incr.n
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:1k
- '"
- '" Copyright (c) 1993 The Regents of the University of California.
- '" Copyright (c) 1994-1996 Sun Microsystems, Inc.
- '"
- '" 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.18.1 2004/10/27 12:52:40 dkf Exp $
- '"
- .so man.macros
- .TH incr n "" Tcl "Tcl Built-In Commands"
- .BS
- '" Note: do not modify the .SH NAME line immediately below!
- .SH NAME
- incr - Increment the value of a variable
- .SH SYNOPSIS
- fBincr fIvarName fR?fIincrementfR?
- .BE
- .SH DESCRIPTION
- .PP
- Increments the value stored in the variable whose name is fIvarNamefR.
- The value of the variable must be an integer.
- If fIincrementfR is supplied then its value (which must be an
- integer) is added to the value of variable fIvarNamefR; otherwise
- 1 is added to fIvarNamefR.
- The new value is stored as a decimal string in variable fIvarNamefR
- and also returned as result.
- .SH EXAMPLES
- Add one to the contents of the variable fIxfR:
- .CS
- fBincrfR x
- .CE
- .PP
- Add 42 to the contents of the variable fIxfR:
- .CS
- fBincrfR x 42
- .CE
- .PP
- Add the contents of the variable fIyfR to the contents of the
- variable fIxfR:
- .CS
- fBincrfR x $y
- .CE
- .PP
- Add nothing at all to the variable fIxfR (often useful for checking
- whether an argument to a procedure is actually numeric and generating
- an error if it is not):
- .CS
- fBincrfR x 0
- .CE
- .SH "SEE ALSO"
- expr(n)
- .SH KEYWORDS
- add, increment, variable, value