#1 2020-07-03 16:01:07

zed
Member
From: Belarus
Registered: 2015-02-26
Posts: 105

Does RecordSave and RecordLoad work with packed records only?

Documentation says:

- will handle packed records, with binaries (byte, word, integer...) and
string types properties (but not with internal raw pointers, of course)

so is it mean that only packed records supported?

And the same question about RecordSaveJson - does it work with all records or packed only (documentation says nothing)?

Last edited by zed (2020-07-03 16:01:52)

Offline

#2 2020-07-03 19:08:54

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

Re: Does RecordSave and RecordLoad work with packed records only?

Packed only - unless you define a custom serialization.

Offline

#3 2020-07-04 09:13:24

zed
Member
From: Belarus
Registered: 2015-02-26
Posts: 105

Re: Does RecordSave and RecordLoad work with packed records only?

In this blog-post you wrote:

It is also mandatory that you declare the record as packed.
Otherwise, you may have unexpected access violation issues, since alignement may vary, depending on local setting, and compiler revision.

So, if I will use fixed alignment {$A8} and the same compiler to Save/Load records, can I not use "packed"?

I'm asking because in my simple test it works fine without "packed". Tested on Delphi 10.3.3 (x32/x64).

Offline

Board footer

Powered by FluxBB