Link to home
Start Free TrialLog in
Avatar of hibbidiji
hibbidiji

asked on

E2066 Missing operator or semicolon error for NO reason

I have the following line of code.   If it is in my app, it will fail with the message: E2066 Missing operator or semicolon.  If the line is NOT there, it will compile fine.

Artist is a valid public string to the unit.  

if Length(artist) = 0 then artist := 'Unknown';


Why the heck is this happening?
Avatar of moorhouselondon
moorhouselondon
Flag of United Kingdom of Great Britain and Northern Ireland image

Without seeing a bigger excerpt of the code, it is difficult to advise.  On the face of it, there is no reason for it to fail.  Things to look at:

Is artist or length being used in a different context to normal?  e.g. using artist as the unit name; using length as a variable, using either of these in a Const declaration.  Look for Includes in your code.

What happens if you override the artist declaration by defining it within the function/procedure where this error is occurring?  (I know this will prevent the program from working correctly, but may give a clue where the problem is).
Avatar of Mohammed Nasman
are you sure there's a semicolon before the line you wrote above?

if you show few lines from your code, it will be easier to analyze your problem
Avatar of tobjectpascal
tobjectpascal

I agree, more than likely the problem is with the line above, what's the chances you have a nested if statement / case statment just above?
ASKER CERTIFIED SOLUTION
Avatar of Scay7
Scay7
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial