# 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 4.2.0.6190 Documentation
Generated by portbuild at Mon Aug 12 23:49:50 2013