Home
EXIT should not be used in loops
Rule description
- EXIT should not be used in loops
Non-compliant Code Example
function string TestFunctionCall (string cnt) integer A = 1, B = 1 DO WHILE A <= 15 A = (A + 1) * B; EXIT; //Non compliant code LOOP return cnt end function
Compliant Code Example
function string TestFunctionCall (string cnt) integer A = 1, B = 1 DO WHILE A <= 15 A = (A + 1) * B; IF counter > 10 THEN EXIT; //Compliant code ELSE A = B; END IF; LOOP return cnt end function