[fpc-pascal] Using "array of xxx" in function call, Delphi compatibility

Juha Manninen juha.manninen62 at gmail.com
Sat Aug 13 13:58:39 CEST 2011


2011/8/13 Jonas Maebe <jonas.maebe at elis.ugent.be>

> It is always best to isolate such things in a self-contained example that
> does not depend on external code. Does this compile with your Delphi
> version?
>

Yes, I should have done that. The code you gave does not compile.


If not, the issue is something else. It seems more likely to me that there
> is somewhere another "add" method that Delphi picks up but FPC doesn't.
> E.g., there is at least also "TComponent.Add(item : IUnknown) : Integer;".
> While that one won't accept a dynamic array, maybe Delphi 2009 has more add
> methods in TComponent declared with "overload" (although normally searching
> for overloads should stop as soon as a method is found in a class without
> "overload", so in principle the search should stop when tmenuitem.add is
> encountered).
>
> If the above does compile, what does it actually do? Pass the first element
> of the array?
>

The original code which works in Delphi is interesting because it not only
compiles but it also works perfectly, adding those 2 menuitems to mainmenu.

There is no TComponent.Add, neither in VCL nor LCL.
I try to figure out what is happening...

Thanks for replying.

Juha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20110813/8715572a/attachment.html>


More information about the fpc-pascal mailing list