LabVIEW Idea Exchange

About LabVIEW Idea Exchange

Have a LabVIEW Idea?

  1. Browse by label or search in the LabVIEW Idea Exchange to see if your idea has previously been submitted. If your idea exists be sure to vote for the idea by giving it kudos to indicate your approval!
  2. If your idea has not been submitted click Post New Idea to submit a product idea to the LabVIEW Idea Exchange. Be sure to submit a separate post for each idea.
  3. Watch as the community gives your idea kudos and adds their input.
  4. As NI R&D considers the idea, they will change the idea status.
  5. Give kudos to other ideas that you would like to see in a future version of LabVIEW!
cancel
Showing results for 
Search instead for 
Did you mean: 

Reverse order indexing for Map on for loop

Status: New

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.

 

Capture d’écran 2020-10-06 103344.png

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.

Epictetus

Antoine Chalons

4 Comments
Proven Zealot

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:

Reverse Map.PNG

(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")...

Proven Zealot

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.

Proven Zealot

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.

Proven Zealot

The reverseability (via flagging) and the reverse indexing are both good suggestions. I'll add my personal kudos.