Delphi Error – E2067 Missing parameter type

Delphi Compiler Error

E2067 Missing parameter type

Reason for the Error & Solution

This error message is issued when a parameter list gives no type for a value parameter.

Leaving off the type is legal for constant and variable parameters.

program Produce;

procedure P(I;J: Integer);                            (*<-- Error message here*)
begin
end;

function ComputeHash(Buffer; Size: Integer): Integer; (*<-- Error message here*)
begin
end;


begin
end.

We intended procedure P to have two integer parameters, but we put a semicolon instead of a comma after the first parameters. The function ComputeHash was supposed to have an untyped first parameter, but untyped parameters must be either variable or constant parameters – they cannot be value parameters.

program Solve;

procedure P(I,J: Integer);
begin
end;

function ComputeHash(const Buffer; Size: Integer): Integer;
begin
end;

begin
end.

The solution in this case was to fix the type in P’s parameter list, and to declare the Buffer parameter to ComputeHash as a constant parameter, because we don’t intend to modify it.

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Delphi Compiler Error X2421 Imported identifier ‘%s’ conflicts with ‘%s’ in ‘%s’ Reason for the Error & Solution This occurs...
Delphi Compiler Error X2367 Case of property accessor method %s.%s should be %s.%s Reason for the Error & Solution No...
Delphi Compiler Error X2269 Overriding virtual method ‘%s.%s’ has lower visibility (%s) than base class ‘%s’ (%s) Reason for the...