Change the example for NextMapElement() and ResetMap()
Posted: Fri Dec 01, 2023 8:01 pm
This is not really a bug, but a request to change the example codes for ResetMap() and NextMapElement()
At the moment, the example code and debug output is:
A more "random" output (compared to the order of creation) can avoid such miss conclusion.
At the moment, the example code and debug output is:
Code: Select all
NewMap Country.s()
Country("US") = "United States"
Country("FR") = "France"
Country("GE") = "Germany"
ResetMap(Country())
While NextMapElement(Country())
Debug Country()
Wend
This output could lead to the suggestion that the map elements are in the order in which they were created (like a linked list). But this isn't the case in general.United States
France
Germany
A more "random" output (compared to the order of creation) can avoid such miss conclusion.
Code: Select all
NewMap Country.s()
Country("GE") = "Germany"
Country("IT") = "Italy"
Country("FR") = "France"
Country("US") = "United States"
ResetMap(Country())
While NextMapElement(Country())
Debug Country()
Wend
One can also add an additional comment.Italy
United States
France
Germany