IResourceExporter.Export

Syntax

Export;

Description

The Export method exports resources.

Comments

On export two symbols "New line" are used as a separator of resource string elements, one symbol "New line" is used to separate strings of the multistring resource element (for example, the strings of the ListBox component).

Example

Executing the example requires that the repository contains resources with the RESOURCES identifier. Russian and English languages should be in the given resources.

Sub ExportResource;
Var
    MB: IMetabase;
    ResObj: IResourceObject;
    Consumer: DtTextConsumer;
    ExpObj: ResourceExporter;
    Countries: Array[0..1Of String;
Begin
    MB := MetabaseClass.Active;
    ResObj := MB.ItemById("RESOURCES").Edit As IResourceObject;
    Consumer := New DtTextConsumer.Create;
    Consumer.File := "C:\Res.txt";
    Consumer.WriteHeader := True;
    ExpObj := New ResourceExporter.Create;
    ExpObj.Consumer := Consumer;
    Countries[0] := "ru";
    Countries[1] := "en";
    ExpObj.Locales := Countries;
    ExpObj.Resource := ResObj;
    ExpObj.Export;
End Sub ExportResource;

After executing the example all resources strings referred to Russian and English languages are exported into the C:\Res.txt file.

See also:

IResourceExporter