IMetabaseCustomObjectReader.ReadToFile

Syntax

ReadToFile(FileName: String);

Parameters

FileName. A full name of the file, to which data from the object will be read.

Description

The ReadToFile method reads data from the custom class object and loads it to the specified file.

Comments

Before executing the ReadToFile method, call the Load method to read data from the repository base to the current object in the PC memory.

Example

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:

IMetabaseCustomObjectReader