[fpc-pascal] got "untyped" expected "<procedure variable type of procedure(TObject) of object; Register>"

rupert THURNER rupert.thurner at gmail.com
Tue Jul 15 20:56:19 CEST 2014


hi,

what am i doing wrong with lazarus 1.2.2 to get the error "untyped" expected
"<procedure variable type of procedure(TObject) of object;Register>", see
below when assigning "OnClick".

type
  TForm1 = class(TForm)
    procedure SpeedButton1Click(Sender: TObject);

procedure TForm1.SpeedButton1Click(Sender: TObject);

procedure TForm1.CreateButton(t: Integer;l: Integer;btext: String; machine:
String);
var
  button: TSpeedButton;
begin
  button:=TSpeedButton.Create(self);
  button.OnClick:=SpeedButton1Click(button);
  // gives error:
  // unit1.pas(121,19) Error: Incompatible types: got "untyped" expected
"<procedure variable type of procedure(TObject) of object;Register>"

regards,

rupert





More information about the fpc-pascal mailing list