Action Block to copy dictionary keys to an array

Dm114

Well-known member
Here's an Action Block (included in a simple macro for illustrative and test purpose) to copy dictionary keys to an array to:
- allow selecting a key without typing long case sensitive strings ;
- benefit alphabetical sort order of dictionary keys.

INPUT variables:
- Dictionary: mandatory dictionary type variable containing the dictionary keys to extract ;
- Index0: optional string variable to set a special string to "ArrayOUT[0]". If not empty, "ArrayOUT[1]" will contain the first dictionary key instead of "ArrayOUT[0]".

OUTPUT variable:
- ArrayOUT: single level array type containing all "Dictionary" keys, in ascending order, from index 0 or 1 (depending on "Index0" input variable content).

💡 HINT: "Index0" input variable may contain a string such as "<EXIT>" so that when entering 0 (or selecting this item) in the calling macro, it becomes easy to exit the routine (to erase all unnecessary space consuming variables for instance)...


Enjoy!
 
Top