User | Kudos |
---|---|
10 | |
6 | |
6 | |
5 | |
4 |
I frequently perform operations on Maps of Objects which hold private data where I do not intend to alter the structure of the Map.
However, Maps are a bit clunky to work with when operating on all Elements. You must first get the list of all Keys, then use an In Place Element Structure within a For Loop and Shift Registers to operate on each Element as follows:
Potential issues with this:
It would be great if there were some kind of auto-associating tunnel available to For Loops:
Note that the Key is not modifiable, nor is it even available within the For Loop.
Perhaps the tunnel icons must be changed so they are not confused with shift registers. I just copied the association icon from the map datatype icons.
This level of functionality is similar to the syntactical abbreviations available in most languages which support maps as a standard data type. I originally wanted this kind of functionality for Sets as well, however modifying the values may result in structural changes to the set itself due to the uniqueness constraint. As such, this is only applicable to Map Values within For Loops.
It may not be obvious, but this kind of tunnel would not be available to While loops.
This option would be available on the block diagram through the context menu items of the Map datatype Input Tunnel to the For Loop.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.