Hi all,
there is the old issue that %var gets expanded to %var both if unset or if
set to the empty string.
This behavior makes a PITA to create tasks that are able to take empty
strings as arguments, because not only these tasks have to special-case the
unset/empty case but also every caller, caller of caller, etc. of the tasks.
For example, take a task T1 that replaces the string PLACEHOLDER in an url
with the contents of %par1, where %par1 can be the empty string.
Now there is a caller T2 ot T1 with a local variable %query initialized
from its own %par1 that calls T1(%query).
The there is a caller T3 of T2 which does T2(%stuff).
T1 could expand %par1 to %par1, %stuff, %query or a "real" string
depending on the circumstances. And by all means it hasn't to rely on
checking for values like %stuff or %query that depend on the eventual
caller.
Currently there are two solutions to this problem:
1. Every task checks for unset, which absurdly duplicates the code.
2. You adopt an internal convention, for example %MY_EMPTY=!#*@&#*@!#!@,
then just special case %MY_EMPTY in T1, which only duplicates T1 code.
Both solutions sucks IMO. I love Tasker but this is extremely bizarre.
I understand that "fixing" the evaluator to expand %var to an empty string
in case it contains, well... an empty string, is backwards incompatible and
will make many people unhappy.
But what about adding a toggle at the task level or at the global level to
force a saner behavior for people starting from scratch?
And also, Tasker might add an official %EMPTY variable to initialize empty
vars.
Cheers
Carlos
Carlos Pita 's gravatar image asked Feb 17 2017 at 08:43 in Tasker by Carlos Pita

5 Answers

I know it's a pain and apologize.
Will think about it some more.
Pent
Pent 's gravatar image answered Feb 18 2017 at 01:52 by Pent
Ok, Pent, thank you for considering it, I'm copying this to the feature request forum (didn't realize there was one before).
Carlos Pita 's gravatar image answered Feb 18 2017 at 15:14 by Carlos Pita
I'm copying this to the feature request forum (didn't realize there was
I did not realize this either... Where did you find such a thing???
Rich D 's gravatar image answered Feb 18 2017 at 15:58 by Rich D
Google. But it seems to have been closed since a few days ago given
that the backlog of requests was too big.
Carlos Pita 's gravatar image answered Feb 18 2017 at 16:05 by Carlos Pita
Been closed for around 5 years I think :-)
Pent
Pent 's gravatar image answered Feb 18 2017 at 22:40 by Pent