IResourceExporter.Strings

Syntax

Strings: Array;

Description

The Strings property determines the lines of resources for the export.

Comments

If the given property is not determined, all resource strings are exported.

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 Main;
Var
    MB: IMetabase;
    MObj: IMetabaseObject;
    ExpObj: ResourceExporter;
    Cons: DtTextConsumer;
    ResObj: IResourceObject;
    CountrysArr: Array[0..1Of String;
    ResStrings: IResourceStrings;
    Strings: Array[0..1Of String;
    i: Integer;
    Key: Integer;
Begin
    Cons := New DtTextConsumer.Create;
    ExpObj := New ResourceExporter.Create;
    MB := MetabaseClass.Active;
    MObj := MB.ItemById("RESOURCES").Edit;
    ResObj := MObj As IResourceObject;
    Cons.File := "C:\Res.txt";
    Cons.WriteHeader := True;
    ExpObj.Consumer := Cons;
    CountrysArr[0] := "ru";
    CountrysArr[1] := "en";
    ExpObj.Locales := CountrysArr;
    ResStrings := ResObj.Strings;
    For i := 0 To 1 Do
        Key := ResStrings.Key(i);
        Strings[i] := ResStrings.Id(Key);
    End For;
    ExpObj.Strings := Strings;
    ExpObj.Resource := ResObj;
    ExpObj.Export;
    End Sub Main;

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

See also:

IResourceExporter