IMetaMemberLeaf.CompoundKey

Syntax

CompoundKey: Variant;

Description

The CompoundKey property determines compound key of an element.

Comments

Unique compound key of the element is set in the IMetaMemberLeaf.CompoundIdentity property.

Example

Executing the example requires a form with a button with the Button1 identifier, and the MetaAttributesTreeList component with the MetaAttributesTreeList1 identifier. Time series database must be defined for MetaAttributesTreeList1.

The example is a handler of the OnClick event for the Button1 component.

// Handler of the OnClick event
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    nSelNodes: Array;
    pMembers: IMetaMembersSet;
    pMember: IMetaMember;
    pLeaf: IMetaMemberLeaf;
Begin
    nSelNodes := MetaAttributesTreeList1.GetSelectedNodes;
    pMembers := MetaAttributesTreeList1.GetNodesMembers(nSelNodes);
    If Not pMembers.Eof Then
        pMembers.Reset;
        Repeat
            pMember := pMembers.Current;
            If pMember.IsLeaf Then
                pLeaf := pMember As IMetaMemberLeaf;
                Debug.WriteLine("Identity: " + pLeaf.Identity.ToString);
                Debug.WriteLine("CompoundIdentity: " + ToString(pLeaf.CompoundIdentity));
                Debug.WriteLine("Key: " + pLeaf.Key.ToString);
                Debug.WriteLine("CompoundKey: " + ToString(pLeaf.CompoundKey));
                Debug.WriteLine("__________________");
            End If;
            pMembers.Next;
        Until pMembers.Eof;
    End If;
End Sub Button1OnClick;

// Data output function
Function ToString(Value: Variant): String;
Var
    s: String;
    arr: Array Of Variant;
    idx: integer;
Begin
    arr := Value As Array Of Variant;
    For idx := 0 To arr.Length - 1 Do
        s := s + arr[idx] + "; ";
    End For;
    Return s;
End Function ToString;

After executing the example the console window shows information on the time series selected in the MetaAttributesTreeList1 component.

See also:

IMetaMemberLeaf