Keys: ICollection;
The Keys property returns collection of string map keys.
Sub UserProc;
Var
StrMap: IStringMap;
i: Integer;
Keys: ICollection;
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;
Keys := StrMap.Keys;
i := Keys.Count;
End Sub UserProc;
After executing the example a string map is generated, elements with repeated keys are overwritten, and the "i" variable contains the number of keys.
See also: