You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var nr : Integer;
begin
case nr of
1 : {statement};
2 : {statement};
else
{statement};
{statement};
...
{statement};
end;
end;
PascalScript impl seems to assume that the else branch is also a single statement, which is wrong. The else branch of a switch actually forms already a code block: It can hold an arbitrary number of statements without the need of an extra begin/end pair.
It may look inconsistent but it actually is that way back to TurboPascal and earlier.
PascalScript impl seems to assume that the
else
branch is also a single statement, which is wrong. Theelse
branch of aswitch
actually forms already a code block: It can hold an arbitrary number of statements without the need of an extrabegin/end
pair.It may look inconsistent but it actually is that way back to TurboPascal and earlier.
https://www.gnu-pascal.de/gpc/case.html
Found in InnoScript, if that is of any relevance.
The text was updated successfully, but these errors were encountered: