Keys: ICollection;
The Keys property returns the collection of map keys.
Sub UserProc;
Var
StrMap: IStringMap;
Begin
StrMap := New StringMap.Create;
StrMap.Add(GuidGenerator.Generate, "B");
StrMap.Add(GuidGenerator.Generate, "A");
StrMap.Add(GuidGenerator.Generate, "C");
StrMap.Add(GuidGenerator.Generate, "E");
Debug.WriteLine("Keys:");
ShowValues(StrMap.Keys);
Debug.WriteLine("Values:");
ShowValues(StrMap.Values);
End Sub UserProc;
Sub ShowValues(myList: ICollection);
Var
v: Variant;
Begin
For Each v In myList Do
Debug.Write(v + ' ');
End For;
Debug.WriteLine("");
End Sub ShowValues;
After executing the example a map of strings is generated. The generated GUID is used as a key. The map is sorted automatically by key values. Keys and element values are displayed in the development environment console.
See also: