Page 1 of 1

Local vs. Global Variables?

Posted: Tue Apr 07, 2020 1:42 am
by kunkel321
How do I know if a variable is global or local? For example in my "Logic and RegEx Sample" post https://robotask.com/forum/viewtopic.php?f=1&t=2737 those are all "local" variables, correct? They are not ones from the list of "RoboTask Variables" this in Menu>Options>Variables... However I also did not define them 'Local Variables' tab of the Task editor.

Really I'm trying to figure out if it's necessary to set all of the variables to "" (nothing).

Re: Local vs. Global Variables?

Posted: Tue Apr 07, 2020 7:36 am
by Oleg
When you assign the result to some variable (for example Get text from clipboard) the action creates local variable by default (if variable doesn't exist)
If you create global variable with this name then the value will be assigned to global variable.
How do I know if a variable is global or local?
No way.

Read the rules here
Also read here and here and other related chapters about variables