Array as parameter and return values for Subtasks?

554 views
Skip to first unread message

DiSc

unread,
Dec 20, 2011, 4:42:46 AM12/20/11
to Tasker
For my current tasker project I tried to put my filesearch actions in
a subroutine, and I wanted to specify more than three parameters for
the search (the starting directory, the directory search mask and the
file search mask) and return the array of found files. But both seems
to be not possible. I tried different ways (felt that lasts hours...),
i.e. pushing my parameters into an array and pass that array as %par1,
or pass my parameters comma separated...

Thus, two questions:
1. How can I pass more than two parameters to a subtask?
2. How can I return a result array to the calling task?

Kind regards,
Dirk


P.S. Sorry for asking maybe stupid (?) questions, but I found no exact
guide about that.

Matthieu Berthomé

unread,
Dec 20, 2011, 10:38:36 AM12/20/11
to tas...@googlegroups.com
In hte subtask, you can create the return array, and put in the return variable %array(), it's going to be comma-separated of the values inside the array. Then remember to do a variable split after you call the subtask
If you want more than 2 parameters, do the same thing but in reverse, pass it %array() and do the variable split inside the subtask.
For the moment, arrays are "poor man's arrays", they are not a complete data structure, so there are some limitations.
Only the one who doesn't ask questions is stupid ;-)
Reply all
Reply to author
Forward
0 new messages