IStringMap.Clone

Syntax

Clone: IStringMap;

Description

The Clone method creates a copy of map of character strings.

Example

Sub UserProc;
Var
    StrMap, StrMap1: IStringMap;
    i: Integer;
Begin
    StrMap := New StringMap.Create;
    StrMap1 := New StringMap.Create;
    For i := 0 To Math.RandBetweenI(50100Do
        StrMap.Add("Key_" + Math.RandBetweenI(0100).ToString, "Value " + Math.RandBetweenI(0100).ToString);
    End For;
    StrMap1 := StrMap.Clone;
    StrMap.Clear;
End Sub UserProc;

After executing the example a string map of random size is generated, elements with repeated keys are overwritten. The StrMap1 variable contains a copy of the StrMap map.

See also:

IStringMap