assign to variable not working

Discuss RoboTask here
Post Reply
yotamv
Posts: 3
Joined: Thu Mar 17, 2016 9:28 am

assign to variable not working

Post by yotamv »

Hello,
I upgraded to version 6.5 and imported a task from a file.
I'm using file loop and Text loop.
I'm assigning file name to a variable and line text to a variable.
When selecting a variable or using the original imported variable the assignment is not working.
The reason is the curly brackets.
If I remove the curly brackets from the variable name in the assign line the assignment is working.
This seems to be a bug. Any advise?

Thanks you.
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: assign to variable not working

Post by Oleg »

No. This is not a bug.
When you specify variable name you have to specify only variable name without braces.
This described in details here: How to use variables correctly
Oleg Yershov
yotamv
Posts: 3
Joined: Thu Mar 17, 2016 9:28 am

Re: assign to variable not working

Post by yotamv »

Thank you Oleg,
Read and understood.
Notwithstanding, there is some bug in that when using the variable button ({V}) to select the variable to assign a value to, it arrives with curly brackets.
This can be very confusing.

Regards,

Yotam
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: assign to variable not working

Post by Oleg »

Commonly this mechanism is designed to put variables into some expressions

For example:
Now is {DateTime}

When you want to save some value into variable as a rule you specify new variable. So It's better to type variable name manually.

But pay attention: you can compose variable name with using other variables.
For example: string{num}
If variable NUM contains the number we can get such array of variables: string1, string2, string3....stringN
This gives you more flexibility in the task.

BUT if this is too complex for you it's better to avoid this. Just put only variable name explicitly without braces.
Oleg Yershov
yotamv
Posts: 3
Joined: Thu Mar 17, 2016 9:28 am

Re: assign to variable not working

Post by yotamv »

Thank you Oleg.
Post Reply