Export;
The Export method exports resources.
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).
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..1] Of 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: