SetSortedList=CreateObject("System.Collections.SortedList")SortedList.Add"Apple",4SortedList.Add"Banana",2SortedList.Add"Cherry",3SortedList.Add"Durian",5print"Count "&SortedList.Countprint"Key "&SortedList("Durian")print"Value at Index "&CStr(SortedList.GetByIndex(0))print"Index of Key "&SortedList.IndexOfKey("Durian")SortedList.Remove"Durian"SortedList.RemoveAt0Fori=0ToSortedList.Count-1printvbCrLf&SortedList.GetKey(i)&vbTab&SortedList.GetByIndex(i)Next
Output
Count 4
Key 5
Value at Index 4
Index of Key 3
Banana 2
Cherry 3
Dear User, Thank you for visitng KodingWindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.