Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Is there a way to make a Map maintain the order the keys are inserted when iterating on a loop?
Thank you.
Solved! Go to Solution.
Is there a way to make a Map maintain the order the keys are inserted when iterating on a loop?
Thank you.
Solved! Go to Solution.
I think, it is not a feature.
Key OrderingThe Map class is a hash map, so keys in the map are in not guaranteed to be in any order. They are not sorted by comparison, and they are not in insertion order. Even if it appears that you can depend on some particular ordering, that ordering could easily change in a bug fix release or new version of FlexSim.