Welcome to Tasker Tip Tuesdays, quick tips to help grow your Tasker knowledge. This week I discuss how to create variable arrays. If you need to create variable arrays to manipulate and process data you’ll love this useful tip.
Variable arrays are what Tasker refers to as arrays. While not quite a true array, as other programming languages use, it does support something similar. Pent describes them as “pseudo-arrays”. These pseudo-arrays are basically values “just stored in Tasker in index’d positions” as stated by Reddit user /u/Rachet_Guy. Well said Rachet! But what about how to creating them?
[How To] Create Variable Arrays
As stated within Tasker’s userguide, variables section, there are five methods. Each of which resulting in variable arrays:
Array Set, %arr, a b c d
Variable Spliton an existing (simple) variable:
Variable Set %arr a b c d
Variable Split %arr
- by assigning individual elements with
Variable Set, %arr3, c.
Array Pushto add an initial element
- some other actions also create arrays for their results e.g.
Now that you understand how to create variable arrays, let’s play around with some examples to get a better understanding. Enjoy the video below as I provide examples for each of the above five methods.
In order to create variable arrays, just follow one of the above steps. Then, manipulate them to your liking using variable array special syntax.
To catch up on previous posts in this series, visit the Tasker Tip Tuesdays page. As ways, enjoy and keep learning! Until the next Tasker Tip Tuesday…