#1 invalid syntax in the conversion of for-loops

1.0
open
nobody
None
2020-06-30
2020-06-30
Ingo
No
int i;
int a()
{
for(i = 0; i < 2; i++) return;
}

results in:

i: DINT;
FUNCTION a:DINT;
i := 0;

WHILE i < 2;
 DO
 RETURN;

((i:=i+1)-1);
END_WHILE

The semicolon after the while expression is invalid.

Discussion


Log in to post a comment.