Home

GOTO should not be used within loops

Rule description

  • GOTO should not be used within loops

 

Non-compliant Code Example

function string TestFunctionCall (int cnt)

integer A = 1, B = 1
DO WHILE A <= 15
      goto restart; //Non compliant code (GOTO statement is used within loop)
      A = (A + 1) * B
LOOP

messagebox('Test','testing... ')

restart: 
if isvalid(cnt) and not isnull( cnt ) then
	messagebox('Test','is valid found ')
end if

return "

end function
Visual Expert 2020
 VEPBRULE45