6

Action number variable

Add another built-in variable for the current action number, %action, which could be used in user constructed error messages.

3 replies

F

I miss that feature since years!

For debugging reasons, often I put manually the hard coded Action number into some Flash Action, but any adding of another Action before that Flash Action messes the number up, obviously. 

I could perfectly live with a function to get the Action number, I would create a Flash Action with it for debug purpose (if debug=1) which I would copy when needed from my Tools-Tasks ;)

But debug in Tasker is not a nice job at the moment. No problem in small tasks but a pain in the glass in bigger ones.

So please Joao, make that happen, give us an Action number variable! 

Or give us a better way to debug, e.g. Step-By-Step Debug as in any IDE ;)

Thank! Frank

that would do it.

Not only would this prove invaluable for use in diagnostic flash messages, it also allows for the use of local "subroutines". That is, where a small bit of code needs to be used a number of times in a task, but it is too small to warrant the use of forking off another task. For example:

A1: Variable Set [ Name:%exit_mysub To:%action ]
A2: Goto [ Type:Action Label:mysub ]
A3: Flash [ Text:Back from subroutine. ]
...
A499: Stop
<mysub>
A500: Anchor
A501: do something
A502: do something
...
A506: Goto [ Type:Action Number Number:%exit_mysub ]

Obviously an anchor label could be provided as a means of return, but if you are calling the "subroutine" from a number of places you will end up with labels spreading all over the place. 

The only comment I have is that the introduction of a new built in local variable could introduce errors into old code that used the same name. So perhaps a tasker functon could be used to provide the current action number.

this could be avoided by providing the option in the settings for the variable name. we have this already for google id.