INCR statement

Purpose:

INCR increments by 1, scalar or array variables, pointers or user defined TYPEs. INCR is equivalent to Variable = Variable + 1 as well as Variable++.

Syntax 1:

INCR Variable

Parameters:

  • Data type: Scalar
    Variable Scalar or array variable, pointer or user defined TYPE to be incremented.

Example:

INCR I ' Equivalent to I = I + 1 as well as I++

Syntax 2:

INCR Variable, Expression

Parameters:

  • Data type: Scalar
    Variable Scalar or array variable, pointer or user defined TYPE to be incremented.
  • Data type: Scalar
    Expression Value by which Variable is incremented.

Example:

INCR I, B + 2 ' Equivalent to I = I + (B + 2)

Here are more examples.

INCR a              'scalar vars
INCR a, b
INCR a, b + 1

INCR c[j]           'array vars
INCR c[j], b
INCR c[j], b + 5

INCR(*d)            'var value access through pointers
INCR(*d), (*e)
INCR(*d), (*e) + 5

INCR f->i           'byref user defined TYPEs
INCR f->i, b
INCR f->i, g->i
INCR f->i, g->i + 5

INCR k.i            'byval user defined TYPEs
INCR k.i, b
INCR k.i, l.i
INCR k.i, l.i + 5

BCX Console Sample Programs using the INCR statement.