E2066 Missing operator or semicolon error for NO reason

Posted on 2006-03-25
Medium Priority
Last Modified: 2012-06-27
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?
Question by:hibbidiji
LVL 31

Expert Comment

ID: 16292548
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).
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 16293020
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

Expert Comment

ID: 16298343
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?

Accepted Solution

Scay7 earned 2000 total points
ID: 16354021
if Length(artist) = 0 then artist := 'Unknown';


a : length(artist); //assign as integer (a)
if a = 0 then artist := 'unknown';

But ye it should work without doing this...

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question