Add(Key: String; Value: String);
Key. Unique character key of the element.
Value. Element value.
The Add method adds elements into the map of character strings.
Sub UserProc;
Var
StrMap: IStringMap;
i: Integer;
Begin
StrMap := New StringMap.Create;
For i := 0 To Math.RandBetweenI(50, 100) Do
StrMap.Add("Key_" + Math.RandBetweenI(0, 100).ToString, "Value " + Math.RandBetweenI(0, 100).ToString);
End For;
End Sub UserProc;
After executing the example a string map of random size is generated, elements with repeated keys are overwritten.
See also: