#1 2016-12-17 07:50:11

donald7771
Member
Registered: 2016-03-21
Posts: 3

keyword "object"

I found some rare usages of the keyword "object",
type
  TDiffCalc = object
    FirstDiffLineIndex,
    linesAdd, linesMod, linesDel: integer;
    procedure Execute(Text1, Text2: string; Memo1, Memo2: TMemoEx;
      ShowDiffsOnly: boolean);
  end;

from line 32 of ProjectFormViewTwo.pas,and also

TSQLStatementCached = object
Cache: TSQLStatementCacheDynArray;
Count: integer;
Caches: TDynArrayHashed;
DB: TSQLite3DB;
procedure Init(aDB: TSQLite3DB);
function Prepare(const GenericSQL: RaWUTF8): PSQLRequest;
procedure ReleaseAllDBStatements;
end;

from page 109 of Synopse mORMot Framework SAD 1.18.pdf, I just wonder that why "object" is necessary here and if I could use "class" or "record" instead.

Offline

#2 2016-12-17 08:07:01

mpv
Member
From: Ukraine
Registered: 2012-03-24
Posts: 1,571
Website

Re: keyword "object"

You can use record in this cases for unicode delphi versions. Pre. Unicode do not support methods inside records

Offline

#3 2016-12-17 10:21:37

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Offline

#4 2016-12-17 12:30:26

donald7771
Member
Registered: 2016-03-21
Posts: 3

Re: keyword "object"

Thanks a lot to industrious AB and MPV! smile

Offline

Board footer

Powered by FluxBB