Category: Delphi

Delphi – E2014 Statement expected, but expression of type ‘%s’ found

Instead of finding a statement, the compiler discovered an expression of the provided type. The compiler was looking for a statement like an IF, WHILE, or REPEAT in this case, but instead encountered the expression (3+4). The result of the expression (3+4) was assigned to the variable ‘a’ as a solution. Another option would have been to remove the objectionable expression from the source code;…

Delphi – E2010 Incompatible types – ‘%s’ and ‘%s’

When the compiler expects two types to be compatible (or similar), but they turn out to be different, this error message appears. In general, deciding how to overcome type incompatibilities requires a close examination of your software. If you get an error message like this: [DCC Error] Project1.dpr(8): E2010 Incompatible types: ‘Integer’ and ‘Extended’ The expected type (Integer) is the first type in this message,…

Delphi – E2065 Unsatisfied forward or external declaration ‘%s’

Delphi Error E2065 Unsatisfied forward or external declaration ‘%s’ Problem When you have a forward or external declaration of a procedure or function in a class or object type, or a declaration of a method in a class or object type, and you don’t specify the procedure, function, or method anywhere, this error message displays. Perhaps the definition is truly lacking, or perhaps the term…

Delphi – E2052 Unterminated string 

A closing apostrophe at the end of a character string was not found by the delphi compiler. Character strings cannot be continued onto the next line; however, you can concatenate two character strings on separate lines with the ‘+’ operator. If we have two strings, for example, ‘Embarcadero’ and ‘RAD Studio,’ they will be concatenated before runtime. This is true not only for strings, but…

Delphi – E2017 Pointer type required 

When you use the dereferencing operator ” on an operand that isn’t a pointer, and in a very specific instance, when the second operand in a ‘Raise Exception> at address>’ statement isn’t a pointer, you’ll get this error message. Using the dereferencing operator on class types at the source level is forbidden, despite the fact that class types are internally implemented as pointers to the…

Delphi – E2036 Variable required

When you attempt to take the address of an expression or a constant in your delphi program, you will receive this error message. Because a constant, such as 1, does not have a memory address, you cannot use the operator or the Addr standard function on it. How to fix it?

Delphi – E2062 Virtual constructors are not allowed 

In Delphi, Object types, unlike class types, can only have static constructors. The example attempts to specify a virtual function Object() { [native code] }, which is not appropriate for object types and thus unlawful. The solution is to either make the constructor static, or to use a new-style class type which can have a virtual constructor.

Delphi – E2081 Assignment to FOR-Loop variable ‘%s’

Inside the for loop, it is prohibited to set a value to the for loop control variable. Use a break or goto statement if the goal is to exit the loop early. The programmer assumed that setting 99 to I would lead the programme to exit the loop in this scenario. A break statement is a more elegant approach to end a for loop.

Delphi – E2055 Illegal type in Read/Readln statement

When you try to read a variable that isn’t of a legal type in a Read or Readln, you’ll get this error in your delphi program. Check the variable’s type and make sure you don’t have any dereferencing, indexing, or field selection operators missing. Variables of enumerated types cannot be read directly. Reading a string and looking it up in an auxiliary table is the…

Delphi – E2005 ‘%s’ is not a type identifier

This error message appears when the compiler expects the name of a type but finds a name that does not exist. The type of the argument in the example is incorrectly identified as the name of the variable rather than the name of the type. Check to see if the offending identifier is a type – it could be misspelt, or another identifier with the…

Delphi – E2026 Constant expression expected

The Delphi compiler was expecting a constant expression here, but the expression it found was not constant. Even though its parameters are constants, the call to Pos is not a constant expression to the compiler, and it might theoretically be evaluated at compile time.

Delphi – E2032 For loop control variable must have ordinal type

A for loop’s control variable in delphi must be of the types Boolean, Char, WideChar, Integer, Enumerated, or Subrange. The for loop control variable in the example is of type Real, which is not allowed. How to fix it? Use the Integer ordinal type instead. If you utilise an Int64 or Variant control variable in a FOR loop, you can get this error. This is…

Delphi – E2021 Class type required

A class type is required in some cases by the compiler: As a class type’s ancestorIn a try-except statement, in the on-clause.A raise statement’s first argument.In a forward specified class type, as the final type. A Class Declaration must include a Class Type.If you try to declare a class with no parent class that implements one or more interfaces, you’ll get this error. Consider the…