Hi<br><br>While reading a bug report I made the following experiment with Delphi 2009 and then with Lazarus + FPC 2.4.4.<br><br>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).<br>
Still, to my surprise, the code works in Delphi.<br><br>FPC says: Error: Incompatible type for arg no. 1: Got "Dynamic Array Of TMenuItem", expected "TMenuItem"<br>which is what I expected also from Delphi.<br>
<br>---<br>procedure TForm1.FormCreate(Sender: TObject);<br>var<br>  ma: array of TMenuItem;<br>  mi: TMenuItem;<br>begin<br>  SetLength(ma, 2);<br><br>  mi := TMenuItem.Create(MainMenu1);<br>  mi.Caption := 'File';<br>
  ma[0] := mi;<br><br>  mi := TMenuItem.Create(MainMenu1);<br>  mi.Caption := 'Help';<br>  ma[1] := mi;<br><br>  MainMenu1.Items.add(ma); // Works in Delphi<br>end;<br>---<br><br>Is this a known issue?<br><br>Regards<br>
Juha<br><br>