Basic Script and Local Variable

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

Basic Script and Local Variable

Post 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
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Basic Script and Local Variable

Post 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.
Last edited by Oleg on Fri Jun 22, 2012 12:48 pm, edited 1 time in total.
Vara04
Posts: 54
Joined: Fri Feb 24, 2012 8:02 pm
Location: France

Basic Script and Local Variable

Post 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
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Basic Script and Local Variable

Post 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.
Vara04
Posts: 54
Joined: Fri Feb 24, 2012 8:02 pm
Location: France

Basic Script and Local Variable

Post by Vara04 »

Ok It works fine.
I've began with a complex test script and I've made a mistake.
Post Reply