FOR loop

This test case it part of the test suite proposed for new devices.

Test case ID: R0040
Language: ST

Code:
tests2/t0040.st

PROGRAM Test_R0040

VAR
    r : REAL     :=     -1.1;
    i,j,k : INT;
END_VAR

    FOR i := 1 TO 10 BY 2 
    DO
        // This is the same as r := r + 2
        r := r + 0.6;
        r := r + 0.4;
        r := r + 1.2;
        r := r - 0.2;
    END_FOR;
    
    j :=3;
    FOR i := 1 TO j + 3   
    DO
        k := i;
    END_FOR;
_GEB_ASSERT_EQFLOAT_(r , 8.9);
END_PROGRAM