Help! How to create array with custom dictionary

Ouitoo

New member
First, just a comment. I thought I was familiar with arrays from working with them in other languages. But, I am totally lost about them in Macrodroid. This while dictionary thing is a beast if a different color.

Now, my ask. Can some kind soul please TTMLIA 5 years old and tell me how to create an array with 3 positions having index keys of "Personal" "Promotions", and "Social"? I want to increment a counter variable in each array element, and to do so I'd expect to do a SET VARIABLE [ArrayName][Personal] to value+1.

So I'd look at it in my local Variables screen and see the ArrayName variable with 3 entries, and when I click it I'd see the list of those three indexes and each would have a number beside it.

Is this possible?
 

Endercraft

Moderator (& bug finder :D)
What you're describing is a dictionary,with key-value pairs. An array is a collection of values without keys that you can access with an index (0, 1, 2).
 

Dm114

Well-known member
First, just a comment. I thought I was familiar with arrays from working with them in other languages. But, I am totally lost about them in Macrodroid. This while dictionary thing is a beast if a different color.

Now, my ask. Can some kind soul please TTMLIA 5 years old and tell me how to create an array with 3 positions having index keys of "Personal" "Promotions", and "Social"? I want to increment a counter variable in each array element, and to do so I'd expect to do a SET VARIABLE [ArrayName][Personal] to value+1.

So I'd look at it in my local Variables screen and see the ArrayName variable with 3 entries, and when I click it I'd see the list of those three indexes and each would have a number beside it.

Is this possible?
To illustrate @Endercraft's explanation here's a visual scheme:

MacroDroid ARRAY
Index #Value
0any value (numerical, string, etc.)
......
nany value (numerical, string, etc.)

MacroDroid DICTIONARY
KeyValue
string key Aany value (numerical, string, etc.)
......
string key Zany value (numerical, string, etc.)
 
Top