Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-01

Is this a Bug in Lazarus/FreePascal

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Tommi Prami

Hello,

(I am using latest Daily Snapshot

I am trying to assignn eventhandler from my own class, for the form, but compile(r) seems to think that I am trying to make an call to that method, not assing it into the evenhandler

I have method in class declare as :
     procedure OnInternalKeyUpEvent(Sender: TObject; var Key: Word;
Shift: TShiftState);

and I am trying to assign it as KeyUp event handler for the TForm:

   if Assigned(FParentForm) then
   begin
     FParentForm.OnKeyUp := OnInternalKeyUpEvent;
   end;
mwWin32WinCEBridge.pas(175,48) Error: Wrong number of parameters
specified for call to "OnInternalKeyUpEvent"

Is this a bug or do I need to do something different.

I think this works in Delphi...

-TP-

Mattias Gaertner
to Tommi Prami
Show quoted text 17 lines
Hello, (I am using latest Daily Snapshot I am trying to assignn eventhandler from my own class, for the form, but compile(r) seems to think that I am trying to make an call to that method, not assing it into the evenhandler I have method in class declare as : procedure OnInternalKeyUpEvent(Sender: TObject; var Key: Word; Shift: TShiftState); and I am trying to assign it as KeyUp event handler for the TForm: if Assigned(FParentForm) then begin FParentForm.OnKeyUp := OnInternalKeyUpEvent;

In mode objfpc:

FParentForm.OnKeyUp := @OnInternalKeyUpEvent;
Show quoted text 8 lines
end; mwWin32WinCEBridge.pas(175,48) Error: Wrong number of parameters specified for call to "OnInternalKeyUpEvent" Is this a bug or do I need to do something different. I think this works in Delphi...

See
http://wiki.lazarus.freepascal.org/Code_Conversion_Guide#Selecting_the_right_compiler_mode

Mattias