Page 1 of 1

Basic Script and Local Variable

Posted: Fri Jun 22, 2012 7:53 am
by Vara04
I can get a local variable in Basic script with:
RoboTaskApp.ExpandText("{V_VAR_NAME}")

But how can I set a value in local variable?
RoboTaskApp.SetUserVariable("V_VAR_VALUE", "my value")
seams to only work with global variable (user variable) but not with local variable

Basic Script and Local Variable

Posted: Fri Jun 22, 2012 8:48 am
by Oleg
If you want to use local variable you should declare local variables in task editor. Look at "Local variables" tab of task editor.
Also read more about local variables here.

If you not declare local variable then RoboTask creates and uses global variables instead.

Basic Script and Local Variable

Posted: Fri Jun 22, 2012 11:19 am
by Vara04
I'm ok with local variable. But the problem is to set them in Basic Script.
RoboTaskApp.SetUserVariable seams to not modify value

Basic Script and Local Variable

Posted: Fri Jun 22, 2012 11:37 am
by Oleg
I've just tested it in small example. Expression RoboTaskApp.SetUserVariable sets value to local variable correctly.
I can send the example to you if it's necessary.

Basic Script and Local Variable

Posted: Sun Jun 24, 2012 6:16 pm
by Vara04
Ok It works fine.
I've began with a complex test script and I've made a mistake.