Returning variable array

53 views
Skip to first unread message

John Doe

unread,
Mar 31, 2017, 12:59:36 PM3/31/17
to Tasker - Developers
In my plugin I return two arrays. It's possible that one of them is empty. What is the best way? I mean if I don't send to Tasker the variable and this is the second action Tasker keeps the old value. So maybe I should send to Tasker an empty arraylist, is it the right thing to do? What about variables? Is there a way to force Tasker to unset or clear a variable?

Pent

unread,
Apr 5, 2017, 3:00:31 AM4/5/17
to Tasker - Developers
According to the code, variable names with null values have existing values removed.

However, you can't delete a whole array at once like that, because since the value is null
Tasker doesn't know whether the object is/was an array form or not originally.

I will change it so that if the key is e.g. %arr and the value is null, and %arr doesn't exist,
delete any array indices of %arr (%arr1, %arr2 etc)

As a workaround currently, you could send Tasker values %arr1 %arr2 etc each with null values, though
it's disgustingly clumsy.

Pent
Reply all
Reply to author
Forward
0 new messages