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

2011-08-13 Thread Sven Barth
On 13.08.2011 18:30, Jonas Maebe wrote: On 13 Aug 2011, at 18:17, Sven Barth wrote: Related question, but the other way round. The following code does compile in FPC (didn't test Delphi). Is that by design? [snip passing single element to open array parameter] Yes. It also works in TP/Delph

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

2011-08-13 Thread Jonas Maebe
On 13 Aug 2011, at 18:17, Sven Barth wrote: > Related question, but the other way round. The following code does compile in > FPC (didn't test Delphi). Is that by design? [snip passing single element to open array parameter] Yes. It also works in TP/Delphi. Jonas__

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

2011-08-13 Thread Sven Barth
On 13.08.2011 13:25, Jonas Maebe wrote: On 13 Aug 2011, at 12:28, Juha Manninen wrote: TMainMenu.Items is of type TMenuItem. TMenuItem has only one version of "Add" method and it takes another TMenuItem as parameter (checked from VCL source). Still, to my surprise, the code works in Delphi. F

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

2011-08-13 Thread Juha Manninen
2011/8/13 Ludo Brands > Delphi has a procedure TMenuItem.Add(const AItems: array of TMenuItem); > overload; which isn't implemented in Lazarus. It existed already in > Delphi6. So, not a compiler issue. > Ludo, you are right. Somehow I missed it. Uhhh... Ctrl-Click leads to the other "Add". Pro

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

2011-08-13 Thread Juha Manninen
2011/8/13 Jonas Maebe > 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

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

2011-08-13 Thread Ludo Brands
> > TMainMenu.Items is of type TMenuItem. TMenuItem has only > one version > > of "Add" method and it takes another TMenuItem as parameter > (checked > > from VCL source). Still, to my surprise, the code works in Delphi. > > > > FPC says: Error: Incompatible type for arg no. 1: Got > "Dynamic

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

2011-08-13 Thread Jonas Maebe
On 13 Aug 2011, at 12:28, Juha Manninen wrote: > TMainMenu.Items is of type TMenuItem. TMenuItem has only one version of > "Add" method and it takes another TMenuItem as parameter (checked from VCL > source). > Still, to my surprise, the code works in Delphi. > > FPC says: Error: Incompatible ty

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

2011-08-13 Thread Juha Manninen
Hi While reading a bug report I made the following experiment with Delphi 2009 and then with Lazarus + FPC 2.4.4. TMainMenu.Items is of type TMenuItem. TMenuItem has only one version of "Add" method and it takes another TMenuItem as parameter (checked from VCL source). Still, to my surprise, the