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


_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to