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.

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 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 contain an untyped first parameter, however untyped parameters can only be variables or constants, not value parameters.

program Solve;

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

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

begin
end.

In this example, the solution was to fix the type in P’s parameter list and declare the Buffer argument to ComputeHash as a constant parameter because we weren’t planning on changing it.

%d bloggers like this: