WriteFromFile(FileName: String);
FileName - complete filename from that data are received for writing.
The WriteFromFile method writes data in an object from a file.
Executing the example requires that the repository contains a custom class object with the OBJ_CUSTOM identifier. There also must be the file C:\From.txt.
Sub Main;
Var
Mb: IMetabase;
Object: IMetabaseObject;
CustomObject: IMetabaseCustomObject;
Writer: IMetabaseCustomObjectWriter;
Begin
Mb := MetabaseClass.Active;
Object := Mb.ItemById("OBJ_CUSTOM").Edit;
CustomObject := Object As IMetabaseCustomObject;
Writer := CustomObject.CreateWriter;
Writer.WriteFromFile("C:\From.txt");
Writer.Save;
Object.Save;
End Sub Main;
After executing this example data from the file C:\From.txt is read and saved in a custom object.
See also: