Category: Delphi

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.