IStringMap.Item

Syntax

Item(Key: String): String;

Parameters

Key. Element key.

Description

The Item property determines value of the element with the specified key.

Example

Sub UserProc;
Var
    StrMap: IStringMap;
    i: Integer;
    s: String;
Begin
    StrMap := New StringMap.Create;
    For i := 0 To Math.RandBetweenI(50100Do
        StrMap.Add("Key_" + Math.RandBetweenI(0100).ToString, "Value " + Math.RandBetweenI(0100).ToString);
    End For;
    s := StrMap.Item(StrMap.Key(StrMap.Count - 1));
End Sub UserProc;

After executing the example a string map is generated, elements with repeated keys are overwritten, and the "s" variable contains value of the last element.

See also:

IStringMap