When indexing a map on a for loop, the indexing is automatically done by ascending order on the key value.
I like this as a default behavior.
I'd like to have a context menu option to force the for loop indexation to be done in reverse order.
We have two ears and one mouth so that we can listen twice as much as we speak.
Just for maps? Or also for sets? Arrays are easy to reverse 'manually', but if it's added for maps, and sets, why not for all 'containers'?
Alternatively, maps and sets could get a flag (conceptually) that would make 'Reverse 1D Array" work on them:
(This could internally be implemented with a SubMap, SubSet structure, like SubArrays and SubStrings do for arrays and strings.)
AFAIC, This would qualify as a detail of your idea ("Reverse order indexing for Map on for loop")...
LabVIEW Programming ((make LV more popular, read this)
I was kinda hoping that the Index function would work on maps, and then you could just index the map at ([Map Size] - i) - 1 but that doesn't work either. Maybe this idea could be that more array functions could work on maps.
Unofficial Forum Rules and GuidelinesGet going with G! - LabVIEW Wiki.12 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
Hoovah: Indexing deliberately does not work on sets or maps. They are not directly indexable data structures the way arrays are, and if you need indexing, you should use a different data structure. Every "index" into them would be a full linear traverse to that point in the structure. Not the right choice.
The reverseability (via flagging) and the reverse indexing are both good suggestions. I'll add my personal kudos.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.