Show: Object Pascal C++
Display Preferences

E2138 Invalid message parameter list (Object Pascal)

From Appmethod Topics
Jump to: navigation, search

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

A message procedure can take only one, VAR, parameter; it's type is not checked.


program Produce;

  type
    Base = class
      procedure Msg1(x : Integer); message 151;
      procedure Msg2(VAR x, y : Integer); message 152;
    end;

  procedure Base.Msg1(x : Integer);
  begin
  end;

  procedure Base.Msg2(VAR x, y : Integer);
  begin
  end;

begin
end.

The obvious error in the first case is that the parameter is not VAR. The error in the second case is that more than one parameter is declared.


program Solve;

  type
    Base = class
      procedure Msg1(VAR x : Integer); message 151;
      procedure Msg2(VAR y : Integer); message 152;
    end;

  procedure Base.Msg1(VAR x : Integer);
  begin
  end;

  procedure Base.Msg2(VAR y : Integer);
  begin
  end;

begin
end.

The solution in both cases was to only specify one, VAR, parameter in the message method declaration.

Personal tools
In other languages