#101 mORMot 1 » Possible errors found in mORMot Documentation » 2018-12-18 11:14:19

damiand
Replies: 1

Hello,

I'm reading the documentation page and here, I intend to post any possible errors I find.

4.4.1.2. Variant array documents

The code sample of pseudo methods has the following possible errors:

Line 4:

writeln(V1.Value(i),':',V2._(i));

fires EVariantError exception, I presume the correct version is:

writeln(V1.Value(i),':',V1._(i));

Line 9:

if V1.Exists('John') then

fires EDocVariant exception, while the following change passes:

if V2.Exists('name') then

It seems that the Exists pseudo method can't search for a value in array but can search an object property instead. Both examples are tested with Delphi 10.3 Community and Lazarus 1.9.0/FPC 3.1.1 in Windows 7 64bit.

In the last sample code of the paragraph, the following lines produce compile errors ([dcc32 Error] Project1.dpr(29): E2054 Illegal type in Write/Writeln statement in Delphi 10.3, project2.lpr(98,24) Error: Can't read or write variables of this type in FPC).

writeln(Doc.A['test']);
...
writeln(Doc.A['test']);

If you comment out them, the sample compiles and runs successfully.

#102 Re: mORMot 1 » Latest mORMot.pas does not compile under latest FPC. » 2018-09-21 15:01:45

Not in my case, unfortunately. Using fpcupdeluxe with latest Lazarus/FPC trunk (2.1.0/3.3.1 SVN 59094) on Linux Lite 3.8 (based on Ubuntu), the compilation stops in line 56267 of mormot.pas:

ParamName := @VMP^.Name;

with error message:

mORMot.pas(56267,31) Error: Variable identifier expected

I presume that the solution proposed by Leslie7 in post #5 above, as well as in this topic also:

https://synopse.info/forum/viewtopic.php?id=4694

is recommended, isn't it?

Thanks.

Board footer

Powered by FluxBB