Error Messages/42699

Error Message

Syntax error:
End is not allowed in an expression.

more generally,

«keyword» is not allowed in an expression.

Description

An example where this occurs:

Begin
   Local x:=1;
End
x

In this example, Local expects a body expression after the semi-colon, but instead encounters an unexpected keyword, End, resulting in this syntax error.

Presumably the intended phrasing in this example would have been

Begin
   Local x:=1;
   x
End

The Begin-End here isn't doing anything if this is the entire expression, but this might be extracted from a larger expression.

Comments


You are not allowed to post comments.