IRdsDictionaryTranslations.Remove

Syntax

Remove(Index: Integer): Boolean;

Parameters

Index. Index of a setting in the collection.

Description

The Remove method removes a setting with the specified index from the collection.

Comments

A value of the Index parameter must be a non-negative number but smaller than the value of the IRdsDictionaryTranslations.Count property. Index of the first element in the collection is 0, index of the last one is IRdsDictionaryTranslations.Count - 1. Index numbering is continuous.

If object removal has been completed successfully, the method returns True, value of the IRdsDictionaryTranslations.Count property is decreased by one, otherwise, it returns False.

Example

Executing the example requires an MDM repository that contains the MDM dictionary. The repository identifier is RDS_REPO, the dictionary identifier is RDS_DICT. It is also necessary to add links to the Metabase and Rds system assemblies.

    Sub UserProc;
    Var
        Mb: IMetabase;
        RdsRepoDescr: IMetabaseObjectDescriptor;
        RdsDict: IRdsDictionary;
        DictTransl: IRdsDictionaryTranslations;
    Begin
        Mb := MetabaseClass.Active;
        RdsRepoDescr := Mb.ItemById("RDS_REPO");
        RdsDict := Mb.ItemByIdNamespace("RDS_DICT", RdsRepoDescr.Key).Edit As IRdsDictionary;
        DictTransl := RdsDict.Translations;
        If DictTransl.Count > 2 Then
            If DictTransl.Remove(DictTransl.Count - 1) Then
                Debug.WriteLine(Removal completed successfully);
            End If;
        End If;
        (RdsDict As IMetabaseObject).Save;
    End Sub UserProc;

After executing the example the last setting is removed from the collection. If removal has been completed successfully, a message is displayed in the console window.

See also:

IRdsDictionaryTranslations