From Xojo Documentation
| This item was deprecated in version 2020r2.
Please use Dictionary as a replacement.
The Dictionary class is an unordered, mutable, key-value store that is loosely typed. It implements the Iterable interface, allowing efficient and easy iteration over all key-value pairs.
As shown on GetIterator, if you change the Dictionary while iterating over it using For Each...Next, an exception will be raised. If you find you need to iterate and change the data, you can add a method to get all the keys into an array and then iterate through the array to access the Dictionary values. A method could be something like this:
Var results() As Auto
For Each item As Auto In obj
Now you can call the method to get an array where you can then modify the contents:
' Stuff that can mutate the dictionary
Add items to a Dictionary and loop through them:
months.Value("January") = 31
months.Value("February") = 28
months.Value("March") = 31
months.Value("April") = 30
months.Value("May") = 31
months.Value("June") = 30
months.Value("July") = 31
months.Value("August") = 31
months.Value("September") = 30
months.Value("October") = 31
months.Value("November") = 30
months.Value("December") = 31
For Each days As Xojo.Core.DictionaryEntry In months
Var numDays As Integer = days.Value