Skip to main content

SA0078: istruzioni CASE senza un ramo CASE

determinato CASE-Istruzioni senza CASE-rami e con uno solo ELSE-Istruzione.

Motivazione: A CASE l'istruzione senza casi fa sprecare tempo di esecuzione ed è difficile da leggere.

Importanza: Media

Esempio 85. Esempio
PROGRAM PLC_PRG
VAR
    iVar : INT;
    xTemp : BOOL;
END_VAR
iVar := iVar + INT#1;
//in the following the case descriptions are missing:
CASE iVar OF
    ELSE
        xTemp := NOT xTemp;
END_CASE

Uscita in Messaggi vista:

  • sa_icon_message.png SA0078: Rami CASE mancanti