4 ms·
> ... it didnt have the empty statement ';' ... > Sometimes you were not allowed to end you statements with ';' (since they were ended by the block, so this wou
by jonsen 6y ago
> ... it didnt have the empty statement ';' ...
> Sometimes you were not allowed to end you statements with ';' (since they were ended by the block, so this would require the emptystatement).
Pascal has empty statements. They are exactly that - empty.
In C syntax ; is a statement end token, so the empty statement is ‘;’.
In Pascal ; is a statement separator token, so the empty statement is ‘’, and ‘;’ is two empty statements.
So the typical error is to write “....... ;” where only one statement is syntactically allowed.
Example:
if x > y
then x := y ;
else ... Syntax error.
Only one statement allowed between then and else.
then { x := y ; }
else ... is Ok.
The blocking makes two statements into one.
- andi999 6y agothanks.