Category: Delphi

Delphi – E2050 Statements not allowed in interface part

Only declarations, not statements, are allowed in the interface of a unit in your delphi program. Transfer the procedure bodies to the part where they will be implemented. In the interface portion, we went carried away and gave MyProc a body. The body must be moved to the implementation section, after which everything will be great.

Delphi – E2066 Missing operator or semicolon

Delphi Error E2066 Missing operator or semicolon Problem If there is no operator between two subexpressions or no semicolon between two statements, this error message displays. On the previous line, a semicolon is frequently absent. A ‘+’ operator and a semicolon are missing from the first statement in the example. The first error is reported on this line, and the second is recorded on the…

Delphi – E2080 Procedure DISPOSE needs destructor

This error message is displayed when one of the identifiers in the Dispose parameter list is not a destructor. The constructor was accidentally passed to Dispose in this example. Either supply a destructor to Dispose or remove the second argument as a solution.

Delphi – E2056 String literals may have at most 255 elements

When you create a string type in your delphi program with more than 255 elements, assign a string literal with more than 255 characters to a variable of type ShortString, or have more than 255 characters in a single character string, you’ll see this error notice. You can create large string literals that span multiple lines by concatenating several string literals using the ‘+’ operator….

Delphi – E2034 Too many actual parameters

When a procedure or function call in your delphi program has more parameters than the procedure or function declaration allows, this error message appears. Additionally, when an OLE automation call contains too many (more than 255) or too many named parameters, this error message appears. Max would have found it more convenient if he could take three parameters… Normally, you’d switch to call site to…

Delphi – E2082 TYPEOF can only be applied to object types with a VMT

If you try to use the standard function TypeOf on an object type that doesn’t have a virtual method table, you’ll get this error notice. Declare a dummy virtual procedure to force the compiler to build a VMT as an easy workaround. The example attempts to use the TypeOf standard function on a type TMyObject that lacks virtual functions and thus no virtual function table…