ReadToFile(FileName: String);
FileName. A full name of the file, to which data from the object will be read.
The ReadToFile method reads data from the custom class object and loads it to the specified file.
Before executing the ReadToFile method, call the Load method to read data from the repository base to the current object in the PC memory.
Executing the example requires that the repository contains a custom class object with the OBJ_CUSTOM identifier. There also must be the file C:\To.txt.
Sub Main;
Var
Mb: IMetabase;
Object: IMetabaseObject;
CustomObject: IMetabaseCustomObject;
Writer: IMetabaseCustomObjectWriter;
Reader: IMetabaseCustomObjectReader;
Begin
Mb := MetabaseClass.Active;
Object := Mb.ItemById("OBJ_CUSTOM").Edit;
CustomObject := Object As IMetabaseCustomObject;
Reader := CustomObject.CreateReader;
Reader.Load;
Reader.ReadToFile("C:\To.txt");
Object.Save;
End Sub Main;
After executing this example data are downloaded in a custom object. Then these data are downloaded in the file C:\To.txt.
See also: