You are not logged in.
I tried Record type Dynamic Array service result in Delphi 7.
However, the result lost information after 50th item in Delphi 7 but seems correct in Berlin.
Is it a limitation in mORMot 1.18 & Delphi 7 ?
The code is:
Type
TCodeValue=packed record
Code: string;
Value: string;
end;
TCodeValueArray = array of TCodeValue;
IServiceClient = Interface(IInvokable)
['{E1779C4E-C7E3-4F83-BF94-91E907774384}']
function getLis: TCodeValueArray ;
end;
TServiceClient = class(TInjectableObjectRest,IServiceClient)
public
function getList: TCodeValueArray ;
end;
function TServiceClient.getList: TCodeValueArray;
var
x: integer;
begin
SetLength(result,100);
for x:=Low(result) to high(result) do begin
result[x].Code:=Format('User%0:.3d',[x]);
result[x].Value:=Format('Name%0:.3d',[x]);
end;
end;
test:
var
d: TCodeValueArray;
x: integer;
begin
d:=c.getList;
for x:=Low(d) to High(d) do
writeln(d[x].code+'|'+d[x].value);
end;
I only got this in Delphi 7.
User000|Name000 (first)
.
.
User049|Name049
|
|
.
.
| (100th)
Offline
This is a known limitation of Delphi 7, already documented and explained.
Please search the forum and the documentation before posting here.
See https://synopse.info/forum/viewtopic.php?id=4037
Offline
Hi AB,
Thanks for the reply.
I do read the thread and topic in the document.
But it noticed
If your application is developped on any older revision (e.g. Delphi 7, Delphi 2007 or Delphi 2009), you won't be able to automatically serialize records as plain JSON objects directly.
You have several paths available:
By default, the record will be serialized as binary, and encoded as Base64 text
So, I was wondering might Delphi 7 record will be serialized as binary, and encoded as Base64 text then pass to client.
Now, I see it.
Thanks again.
Offline