On Sat, 5 May 2012 18:15:51 +0200 Krzysztof <dib...@wp.pl> wrote: > Hi, > > ObjectBinaryToText method can save object structure to string, but how > save only some propertys?
ObjectBinaryToText only converts between to formats. It does not save object structures. That is done by TWriter. TWriter normally saves only those properties that differ from the default value. If you provide an ancestor it will save only those properties that differ from the ancestor. > I could use RTTI and TypeInfo, but > ObjectBinaryToText can parse property hierarchy > (Propery1.Subproperty1.Color etc). Or how I can save and read object > from string without object name? > Example: I am creating simple theme manager which save settings of > some control (e.g. TEdit) and must read it not paying attention to the > component name (Edit1, Edit2, Edit3 etc...) Must work like a template. See TReader.ReadRootComponent. If you have a component without csDesigning then it will not set the name. If you want to use your theme manager with some designer components (e.g. the components on a Lazarus or MSEGui designer) then you have to write a driver that returns the right name. Mattias _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal