Local vs. Global Variables?

Discuss RoboTask here
Post Reply
kunkel321
Posts: 30
Joined: Sun Mar 15, 2020 5:23 pm

Local vs. Global Variables?

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

Re: Local vs. Global Variables?

Post 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
Oleg Yershov
Post Reply