inc
Summary
Increments either the input or the first parameter with one.Usage
input|inc( value )
Parameters
Name | Type | Description | Required |
---|---|---|---|
value | number | The value that should be incremented. | Only if the input parameter is omitted. |
Returns
Number (input/parameter incremented with one).Description
This operator increments either the input or the "value" parameter with one and returns the result as an integer. If both are provided, it is the "value" parameter that will be used. Please note that this operator can not be used directly to increment the value of a variable (please refer to the last example).
Examples
Example 1
{255|inc}
or
{inc( 255 )}
The following output will be produced: "256".
Example 2
{def $i=255} {set $i=inc( $i )} {$i}
The following output will be produced: "256".
Balazs Halasy (05/02/2004 10:46 am)
Svitlana Shatokhina (21/12/2006 10:32 am)
Comments