ORM Standalone Demo project doesn’t compile in 5.12.10 and Delphi XE5

Home Forums kbmMW ORM Standalone Demo project doesn’t compile in 5.12.10 and Delphi XE5

Viewing 3 reply threads
  • Author
    Posts
    • #55441
      VadimMest
      Participant

      procedure TForm6.btnCreateTableClick(Sender: TObject);
      begin
      orm.CreateOrUpgradeTable([TPerson,TAccount,TImage{,TBackupImage}]);
      end;

      [dcc32 Error] Unit1.pas(157): E2001 Ordinal type required
      [dcc32 Error] Unit1.pas(157): E2010 Incompatible types: ‘Integer’ and ‘class of TImage’

      How to fix it?

       

    • #55442
      mrluigi2017
      Participant

      Hi,

      If I remember it well there where some serious issues in XE5 with generics which are heavily used in the ORM framework. I think you need XE7 or up.

      • This reply was modified 4 years, 10 months ago by mrluigi2017.
    • #55473
      kimbomadsen
      Keymaster

      This is a case of XE5 not supporting an implicit creation of an array.
      Instead use orm.CreateOrUpgradeTable(TArray<TClass>.Create(TPerson,TAccount,TImage{,TBackupImage}));

      Check this site for more info:
      https://stackoverflow.com/questions/50994006/how-to-pass-generic-array-as-open-array-parameter-in-delphi

      best regards

      Kim/C4D

    • #55484
      VadimMest
      Participant

      Hello

      This code works:
      orm.UpgradeTable(TArray<TClass>.Create(TMRDOC,TMRDOCROW));

      Thanks

      Vadim Mescheryakov

       

Viewing 3 reply threads
  • You must be logged in to reply to this topic.