Category: Delphi

Delphi – E2015 Operator not applicable to this operand type

When an operator cannot be applied to the operands it was given, such as when a boolean operator is applied to a pointer, this error message is displayed. In this case, a C++ programmer was unsure about operator precedence in Delphi because P is not a boolean expression and the comparison must be parenthesized. The compiler is pleased if we explicitly compare P to nil…

Delphi – E2019 Object type required

When the compiler expects an object type, this error is returned. An object’s ancestor type, for example, must also be an object type. TObject in the unit System has a class type, which means we can’t derive an object type from it. Make that the type identification corresponds to an object type; it could be misspelt or obscured by another unit’s identifier.

Delphi E2013 Type of expression must be INTEGER

Only when the constant expression that specifies the amount of characters in a string type is not of type integer does this error message appear. The example attempts to describe the number of elements in a string as a function of the maximum element of type colour; however, the element count is of type colour, which is prohibited.

Delphi – E2028 Sets may have at most 256 elements

In your Delphi program, When you try to declare a set type with more than 256 elements, you get this error notice. More exactly, the upper and lower limits of the base type must have ordinal values in the range 0..255. BigSet has only 256 elements in the example, yet it is still forbidden. We must ensure that the upper and lower bounds are in…

Delphi – E2070 Unknown directive – ‘%s’

When the delphi compiler detects an unfamiliar directive in a procedure or function declaration, this error message displays. It’s likely that the directive is misspelt or that a semicolon is missing. The calling convention “stdcall” is misspelt in P’s declaration. A semicolon is missing from the Q and GetLastError declarations. The answer is to double-check that the directives are correctly worded and that the required…

Delphi – E2002 File type not allowed here

File types are not permitted as value arguments or as the file type’s base type. They can’t be used as function return types, and you can’t assign them; nevertheless, those mistakes will result in a different error message. The issue is that T is a value argument of type Text, which is a file type in this case. Remember that whatever you write to a…

Delphi – E2008 Incompatible types

When the compiler expects two types to be compatible (that is, highly similar), yet they turn out to be different, this error message appears. This error can arise in a variety of situations, such as when a read or write clause in a property refers to a method with a parameter list that does not match the property, or when a parameter to a standard…

Delphi – E2029 %s expected but %s found 

When there are syntax errors in your Delphi program, this error message occurs. There was most likely a typo in the source, or something was missed. When an error occurs at the start of a line, the true error is frequently found on the preceding line. The compiler anticipates a semicolon after the type Integer to end the variable definition. It can’t locate the semicolon…

Delphi – E2074 Label declared and referenced, but not set ‘%s’

In your delphi application, you declared and used a label, yet there was no label definition in the source code. In the procedure ‘Labeled,’ the label 10 is declared and utilised, but the compiler never finds a definition for it. The basic approach is to make sure that every declared and used label in your application has a definition in the same scope.

Delphi – E2067 Missing parameter type

Delphi Error E2067 Missing parameter type Problem When a parameter list contains no type for a value parameter in your delphi program, this error message is displayed. For fixed and variable arguments, omitting the type is acceptable. We meant method P to have two integer parameters, but instead of a comma after the first parameter, we used a semicolon. The function ComputeHash was expected to…