Skip to main content

Compiler Error C0161

Message: Border <array bound> of array is no constant value

Possible error cause: A variable is specified as an array bound.

Error correction: Use constants for the array bounds.

Example 404. Example of the error:
PROGRAM PLC_PRG
VAR
    i : INT := 3;
    arr1 : ARRAY[1..i] OF INT;
END_VAR

Message:

C0161: Border 'i' of array is no constant value

Error correction:

arr1 : ARRAY[1..3] OF INT;