Skip to main content

Compiler Error C0219

Message: Case contains overlapping range <case range 1 begin> .. <case range 1 end> and <case range 2 begin> .. <case range 2 end>

Possible error cause: Two branches of CASE markers have the same elements or subsets.

Error correction: Make sure that there is no intersecting.

Example 442. Example of the error:
PROGRAM PLC_PRG
VAR
    i : INT;
END_VAR
CASE i OF
  3..5: i := i+2;
  1..4: i := i+2;
ELSE
  i := i+10;
END_CASE;

Message:

C0219: 'CASE' contains overlapping ranges 1 .. 4 and 3 .. 5