Increment and decrement operations

Increment and decrement operations
These two operators work only on numeric operands.
The syntax is:

<target>++
<target>--

++ increments <target> by one, -- decrements <target> by one.
These are equivalent to += 1 and -= 1.
<target> must be an existing variable and contain an integer value.
If <target> contains a real value then the real is truncated to the nearest integer and then incremented or decremented.
Examples

%a=10
echo "Incrementing"
while(%a < 20)
{
    echo %a
    %a++
}
echo "Decrementing"
while(%a > 10)
{
    echo %a
    %a--
}
echo "Testing for loop"
for(%a=0;%a < 10;%a++)
{
    echo %a
}

See also
operators


Index, Language Overview
KVIrc 3.9.99 Documentation
Generated by root at Wed Oct 17 19:34:06 2007