It has always been a source of deep regret for me that Delphi, and, therefore, Lazarus have not implemented genuine object serialization. After all, the basic principles have always been there, for storing/loading components. It seems like a gross oversight not to realize that real-world applications need to store and load DATA. I have played with several different methods both in Delphi and Lazarus - none are completely satisfactory. Why, oh why did Borland/Embarcadero never properly document TFiler, TWriter and TReader? Not to mention the mess that is the RTTI documentation.
This op's problem would be trivial in something like Ruby - define the object, then serialize it to disk using Jason, plain text, XML or, even perish the thought binary! Sadly, I find the background programming concepts too difficult for an old geezer like me!!