Error Messages/46191

< Error Messages
Revision as of 18:04, 1 November 2021 by Lchrisman (talk | contribs) (Created page with "= Example error messages = :Syntax error: 'Then' required here. :Syntax error: expecting Then. :Syntax error: A comparison operator (like = or <>) or Then is expected here....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Example error messages

Syntax error: 'Then' required here.
Syntax error: expecting Then.
Syntax error: A comparison operator (like = or <>) or Then is expected here.

Description

This occurs when you have a malformed expression where the next input token cannot be interpreted in a consistent way given the part of the expression that came before. When it says "Then expected", then you probably have a situation where your expression looks like:

If «something ok» «something unexpected» Then

And it sees the problem when it gets to the «something unexpected» part.

One example would be if you have a stray ')', like this:

... ( If x < 3 ) Then ...
               ↑
Syntax error: expecting Then

Notice that you might come up with multiple ways of describing the problem here. If you visually match the parentheses, you might say that the If doesn't belong. Or you might say that there is an extra, unmatched ')'.

When you see the error message, it asks Do you want to Edit the Definition?. You should answer Yes, at which point it places the caret at the location were it thinks the Then should appear. Missing or extra parentheses (or other grouping constructs) is a common source of this error.

Comments


You are not allowed to post comments.