Results 1 to 2 of 2

Thread: Wrong number of parameters specified for call to SetOnTimer.

  1. #1

    Wrong number of parameters specified for call to SetOnTimer.

    Hallo allemaal,

    Het code fragment is een gedeelte van een component. Bij het compileren
    wordt er een fout boodschap terug gegeven en dan gaat het om de regel:
    FTimer.OnTimer := SetOnTimer; Hoe is dat op te lossen?

    Error: Wrong number of parameters specified for call to SetOnTimer.

    Code:
    Uses
      LCLIntf, LCLType, LMessages,
      Messages,
      SysUtils,
      Variants,
      Classes,
      Graphics,
      Controls,
      Forms,
      Dialogs,
      StdCtrls,
      ExtCtrls;      
    
    ...
    
    Private
       FTimer : TTimer;
       ...
       Procedure SetOnTimer(Sender : TObject);
       ...
    
    
    constructor ...Create(AOwner : TComponent);
    begin
      ... 
      FTimer := TTimer.Create(self);
      ...
      FTimer.OnTimer := SetOnTimer; 
      ...
    end;
    
    Procedure ...SetOnTimer(Sender : TObject);
    begin
      ...
    end;

    Met een vriendelijke groet, Frans

  2. #2
    Counting your refs Paul-Jan's Avatar
    Join Date
    Feb 2002
    Location
    Lage Zwaluwe
    Posts
    2,160
    In Lazarus/FPC is de schrijfwijze met een @ ervoor, tenzij je Delphi mode aan hebt staan:

    Code:
    FTimer.OnTimer := @SetOnTimer;

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •