Array Variables

Chilangosta

New member
We really need array variables in Macrodroid; many of the locale plugins use or require them to function properly.

Tasker does have support for arrays, and I think that porting the same functionality over would be a game-changer.

In Tasker, arrays are indicated by parentheses at the end of the variable name:

Code:
%var_name()

Something similar could work for Macrodroid; maybe

Code:
[v=var_name()]

or

Code:
[va=var_name]

This would hopefully come with the ability to call array elements by their index e.g.
Code:
var_name(3)
.

This would be ideal for situations like returning multiple regex groups from a string (see AutoTools Regex for example), looping through data a variable amount of times, or for keeping track of elements in a stack. Currently the only option we have is manually appending and searching for elements in a string delimited by some character. This is tedious and error prone. This would dramatically reduce the size of some macros that use this work-around, and speed up development of complex macros.

Extensions of array-like data structures could follow in the future: lists, dictionaries, etc. Arrays would be a great start though!!
 
Top