Show: Object Pascal C++
Display Preferences

E2067 Missing parameter type (Object Pascal)

From Appmethod Topics
Jump to: navigation, search

Go Up to Error and Warning Messages (Object Pascal) Index

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.

Personal tools
In other languages