Sign in Join

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

Mailing lists / lazarus / 2014-05

what is function header problem ?

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

FreeMan

I'm trying port some code, I get this error. IDE code complied is work, rename tool working.
what is wrong?
Thank you
Kubuntu 14.04 x64, fpc svn r27818 lazarus svn r45213

/comp/asg.pas(100,10) Error: function header doesn't match the previous declaration
"DrawEx(TCanvas;AnsiString;TRect;TCustomImageList;LongInt;LongInt;LongInt;LongInt;LongInt;Boolean;Boolean;Boolean;Boolean;Boolean;Boolean;Boolean;Boolean;Double;TGraphicsColor;TGraphicsColor;TGraphicsColor;TGraphicsColor;var AnsiString;var AnsiString;var A"

this is function implementation:

function DrawEx(Canvas: TCanvas; s: string; fr: TRect; FImages: TCustomImageList; XPos
, YPos, FocusLink, HoverLink, ShadowOffset: Integer; CheckHotSpot, CheckHeight
, Print, Selected, Blink, HoverStyle, WordWrap
, Down: Boolean; ResFactor: Double; URLColor, HoverColor, HoverFontColor , ShadowColor: TColor; var AnchorVal, StripVal, FocusAnchor , AnchorHint: string; var XSize, YSize, HyperLinks , MouseLink: Integer; var HoverRect, ControlRect: TRect; var CID, CV

   , CT: string; ic: THTMLPictureCache; pc: TPictureContainer;

WinHandle: THandle): Boolean;
begin
//
end;

Reply by email

Hans-Peter Diettrich
to FreeMan
Show quoted text 10 lines
I'm trying port some code, I get this error. IDE code complied is work, rename tool working. what is wrong? Thank you Kubuntu 14.04 x64, fpc svn r27818 lazarus svn r45213 /comp/asg.pas(100,10) Error: function header doesn't match the previous declaration "DrawEx(TCanvas;AnsiString;TRect;TCustomImageList;LongInt;LongInt;LongInt;LongInt;LongInt;Boolean;Boolean;Boolean;Boolean;Boolean;Boolean;Boolean;Boolean;Double;TGraphicsColor;TGraphicsColor;TGraphicsColor;TGraphicsColor;var AnsiString;var AnsiString;var A"

When you override a method in a derived class, the method declaration must match the declaration in the *base class* (previous declaration).

DoDi

Reply by email

FreeMan
to FreeMan: I'm trying port some code, I get this error. IDE code complied is work, rename tool…
interface
uses
   //Graphics, PictureContainer, Classes, Controls, ComCtrls, Dialogs,
ImgList, Messages,LCLType, types, InterfaceBase;

LCLType, {LCLIntf, LMessages,} Graphics, PictureContainer, Classes, Controls

   , ImgList, SysUtils, Messages,  Types, InterfaceBase;

Just changed uses lines. ???

28-05-2014 17:06 tarihinde, FreeMan yazd?:

Show quoted text 11 lines
I'm trying port some code, I get this error. IDE code complied is work, rename tool working. what is wrong? Thank you Kubuntu 14.04 x64, fpc svn r27818 lazarus svn r45213 /comp/asg.pas(100,10) Error: function header doesn't match the previous declaration "DrawEx(TCanvas;AnsiString;TRect;TCustomImageList;LongInt;LongInt;LongInt;LongInt;LongInt;Boolean;Boolean;Boolean;Boolean;Boolean;Boolean;Boolean;Boolean;Double;TGraphicsColor;TGraphicsColor;TGraphicsColor;TGraphicsColor;var AnsiString;var AnsiString;var A"

Reply by email

Sven Barth
to FreeMan: I'm trying port some code, I get this error. IDE code complied is work, rename tool…
"FreeMan" wrote
/comp/asg.pas(100,10) Error: function header doesn't match the previous

declaration
"DrawEx(TCanvas;AnsiString;TRect;TCustomImageList;LongInt;LongInt;LongInt;LongInt;LongInt;Boolean;Boolean;Boolean;Boolean;Boolean;Boolean;Boolean;Boolean;Double;TGraphicsColor;TGraphicsColor;TGraphicsColor;TGraphicsColor;var AnsiString;var AnsiString;var A"

Maybe we should have the compiler report the unit where a parameter type came from as well... (and additionally in this case the "previous declaration")

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140528/4f0a82fb/attachment.html>

Reply by email

FreeMan
to Hans-Peter Diettrich: When you override a method in a derived class, the method declaration must match the…

It was not any class's part, just normal function, (previous declaration) mean at this moment, define in upper on "implementation" area. for can use other units.
Thank you for answer

28-05-2014 17:51 tarihinde, Hans-Peter Diettrich yazd?:

When you override a method in a derived class, the method declaration must match the declaration in the *base class* (previous declaration).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140528/082a1449/attachment.html>

Reply by email