FutureBasic Logo

<<    Index    >> FutureBasic 5

inc   statement



Syntax:
inc(intVar)
intVar ++
numericVariable += IntegerValToAdd

Description:
This statement increments intVar by 1; that is, it adds 1 to the value in intVar, and stores the result back into intVar. intVar must be a (signed or unsigned) byte variable, short-integer variable or long-integer variable. If intVar is already at the maximum value for its variable type, then inc(intVar) will cycle it back to its minimum value.

Example:
inc(x&)
and...
x& ++
and...
x& += 1
...are equivalent to:
x& = x& + 1
The following expressions are also equivalent.
x& = x& + 100
x& += 100


Note:
The += syntax may not be used for arrays of strings, containers, or records (though it may be used in the concatenation of simple strings or containers). Where arrays are involved, only numeric values may take advantage of this syntax. This syntax is valid for values other than 1.

See Also:
dec; inc long/word/byte