You are not logged in.
Pages: 1
Thank you so much.
This is the line that generates the access violation in Delphi 7:
Data.Sale.Invoice:= _Obj([]);
And it is solved if it is replaced by this line:
DocVariantData(Data.Sale).O_['Invoice'];
JSON mORMot2 Delphi 7 Access Violation in mormot.core.base
function FindNonVoidRawUtf8I(n: PPointerArray; name: pointer; len: TStrLen; count: PtrInt): PtrInt;
line 5:
if (PStrLen(p1 - _STRLEN)^ = len) and // same length
((ord(p1^) xor ord(p2^)) and $df = 0) then // same first char
for this code:
Var Data: Variant;
Begin
TDocVariant.New(Data);
Data.Sale:= _Obj([]);
Data.Sale.Id:= '100';
Data.Sale.Number:= '10';
Data.Sale.Invoice:= _Obj([]);
Data.Sale.Invoice.Client:= StringToUtf8('José'); // Access Violation
...
The same code works fine in Delphi 10.2
I understand that I should not use Delphi 7, but I am not allowed to migrate the project to a newer version of Delphi.
I also know that there are other ways to generate the JSON, but in my case if conditions must be added to evaluate at runtime what data to add or not to add to the JSON.
I am grateful for any help you can give me
Thank you very much.
As soon as I have availability to work on the project, I will follow your recommendations.
Some time ago I was studying the documentation of mORMot1, to use mORMot in Delphi 7, because I am giving maintenance to a project developed with Delphi 7. This project is an invoicing software and in the short term they are not going to migrate it to a more recent version of Delphi, according to what the administrators have indicated to me.
When I have availability, I am going to study a little bit the operation of mORMot2 to see how I can develop a simple file server, that allows to send and receive files, similar to a FTP, because I need to be able to send and receive files (.jpg, .pdf, .xml, .docx) between a server and about 20 PCs in a local network, all the computers have Windows. To send a file from a PC to the server you must indicate the relative path, the name and the content of the file. Then to retrieve a file you have to send the relative path and the name of the file. It is something that seems very simple but I have very little experience.
I would be very grateful for any recommendations you can give me.
Broken blog links when link starts with:
https://blog.synopse.info/post
The link works when you add a question mark (?):
https://blog.synopse.info/?post
For example at
https://www.synopse.info/forum/viewtopic.php?pid=21848
@ab posted a link that now does not work:
https://blog.synopse.info/post/2016/09/ … via-SynECC
The link works by adding a question mark (?):
https://blog.synopse.info/?post/2016/09 … via-SynECC
And so one could cite hundreds of similar examples.
The Delphi version can be checked in Delphi, in the menu, Help, About
I had that error and other errors using mormot.lib.win7zip, because I had Delphi Version 7.0 (Build 4.453), indicating that the update was not applied.
I downloaded the update available here
I installed the update and checked again and it had changed to Delphi Version 7.0 (Build 8.1), with that update all the bugs were gone.
Arnaud Bouchez and collaborators thank you very much for all the work you do.
Pages: 1