SA0075: Missing ELSEPermalink

Detects ‎CASE‎ statements without an ‎ELSE‎ branch

Justification: Defensive programming requires the inclusion of an ‎ELSE‎ branch in every ‎CASE‎ statement. If there is nothing to do in the ‎ELSE‎ branch, then include a comment to indicate this. It is then clear to the reader of the code that the case was not simply forgotten.

Importance: Low

PLCopen rule: L17

Example

PROGRAM PLC_PRG
VAR
	iVar : INT;
	xTemp : BOOL;
END_VAR

iVar := iVar + INT#1;
CASE iVar OF
	INT#1:
		xTemp := FALSE;
	INT#2:
		xTemp := TRUE;
END_CASE

--> SA0075: Missing ELSE in CASE statement