Start Task - Assign output variable

Discuss RoboTask here
Post Reply
Vara04
Posts: 54
Joined: Fri Feb 24, 2012 8:02 pm
Location: France

Start Task - Assign output variable

Post by Vara04 »

I want to start a task (Task 2 - template task) from another task (Task 1)
and retrieve values of local variables of task2 in the main task (task1).
It's ok to pass parameters between Task1 to task2 but in the other direction ...

How can I do?
  - A first solution is to use global variables (but be careful if several tasks use the same Task2).
  - Another solution is to put the information into a file (whose name has been given as parameter) and read the result after processing Task2

Do you have other ideas or recommendations?
Last edited by Vara04 on Fri Jun 22, 2012 11:02 am, edited 1 time in total.
Vara04
Posts: 54
Joined: Fri Feb 24, 2012 8:02 pm
Location: France

Start Task - Assign output variable

Post by Vara04 »

I make some tests :
Create/Set/Del variable tasks can't have dynamic name
(in "Variable name" field, we can't set {V_VAR_NAME})

Note that in V_VAR_NAME (local variable) I set "G_VAR"

But this can be done via Basic Script :
Create dynamic global variable :
RoboTaskApp.AddUserVariable(RoboTaskApp.ExpandText("{V_VAR_N AME}"), "Initial value")

=> Now I have a global variable "G_VAR" with "Initial value"

Update dynamic global variable :
RoboTaskApp.SetUserVariable(RoboTaskApp.ExpandText("{V_VAR_N AME}"), "New value")

Delete dynamic global variable :
RoboTaskApp.DelUserVariable(RoboTaskApp.ExpandText("{V_VAR_N AME}"))
Vara04
Posts: 54
Joined: Fri Feb 24, 2012 8:02 pm
Location: France

Start Task - Assign output variable

Post by Vara04 »

It's really a shame not to put the variable name dynamically.

It would be very nice to be able to use this syntax "{V_VAR_NAME}" in the "Variable name" field
in Create/set/delete/increment task,
and also in "Run program", in "Assign exit code to variable"

What do you think about it ?
Post Reply