How to Split a Global Variable without Creating Leftover Global Variables?

14 views
Skip to first unread message

Zohar

unread,
Apr 24, 2017, 10:48:50 AM4/24/17
to Tasker
Hi


I am splitting the Global variable %Date, with action Variable Splitter, and splitter '-'.
It creates 3 new Global variables: %DATE1, %DATE2, %DATE3.

These 3 variables stay in the "VARS" tab, even after the task ends.


Pent, I want to recommend, that maybe if someone is using action Variable Splitter on a Global variable,
then the split resulting variables, will not be global..
That way there will be no left overs after the task ends..


In the meanwhile, what is the most recommended workaround for this?

One option I thought about, is to use action Variable Clear, on %DATE1, %DATE2, and %DATE3.
Another option is: before doing the Split action, to copy %DATE into "%date", and then do the split on "%date"..

(it seems that the second option is shorter)

Any other commend/tip regarding this?


Thank you

Abdullah Alahdal

unread,
Apr 24, 2017, 1:18:12 PM4/24/17
to Tasker
The second options is the way you should follow unless you want to reserve the array.

Zohar

unread,
Apr 24, 2017, 2:05:53 PM4/24/17
to Tasker
Thank you Abdullah

Rich D

unread,
Apr 24, 2017, 6:17:19 PM4/24/17
to Tasker Google Groups Post

It is never a good idea to split a system global variable.

> Another option is: before doing the Split action, to copy %DATE into "%date", and then do the split on "%date"..

That is the correct way to do it. Always use local variables whenever possible as globals require more resources.

Reply all
Reply to author
Forward
0 new messages