The ObjectTreeSerialize attribute function serializes the contents of an object tree, for saving it for example in a file or database. Only variables, which property Save is set, will be serialized.
The object tree contains the object itself and all the child objects of the object.
Syntax | ||||
ObjectTreeSerialize([SaveType]) | ||||
Return value | ||||
Type |
Description | |||
Variant |
Binary data of the object tree | |||
Parameter | ||||
Use |
Name |
Type |
Passing |
Description |
Optional |
SaveType |
Long |
ByVal |
Reserved for future extensions. Must be Null (0). |
Example:
The example shows the saving of the whole object tree, beginning with the object Car, in a file.
Dim FSO As TCEFileSystem.FileSystem
Dim BS As TCEFileSystem.BinaryStream
FSO := New TCEFileSystem.FileSystem
BS := FSO.OpenBinaryFile(SavePath, ForWrite, True)
BS.WriteData(Car.ObjectTreeSerialize)
BS.CloseStream
See also LoadObjectTree