SA0122: Array index defined as expression

Function

Determines the use of expressions in the declaration of array boundaries.

Reason

Not all systems allow expressions as array boundaries.

Importance

Low

Sample:

PROGRAM MAIN
VAR CONSTANT
    cSample  : INT := INT#15;
END_VAR
VAR
    aSample1 : ARRAY[0..10] OF INT;
    aSample2 : ARRAY[0..10+5] OF INT;               // => SA0122
    aSample3 : ARRAY[0..cSample] OF INT;
    aSample4 : ARRAY[0..cSample + 1] OF INT;        // => SA0122
END_VAR