[fpc-pascal] ftGuid displaytext output

2011-08-13 Thread Reinier Olislagers
While trying to export dataset data to XML, I use this for ftGUID fields: FNode := Foutputdoc.CreateTextNode(Utf8decode(GUIDToString(TGuid(EF.Field.Value; This works on Windows 32 and shows a hex representation of the GUID, like {---C000-0046} On Linux x64, I

[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

RE : [fpc-pascal] ftGuid displaytext output

2011-08-13 Thread Ludo Brands
While trying to export dataset data to XML, I use this for ftGUID fields: FNode := Foutputdoc.CreateTextNode(Utf8decode(GUIDToString(TGuid(EF.Fie ld.Value; This works on Windows 32 and shows a hex representation of the GUID, like {---C000-0046}

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 type for

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 Array Of

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

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

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

2011-08-13 Thread Juha Manninen
2011/8/13 Ludo Brands ludo.bra...@free.fr 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

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.

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.

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