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.