Support > Forums > OpenBots Studio > How to create Global Variable
Now we can able to create a variable, but it is visible to that script itself. How to create a variable that should be visible to all the subscripts and Main script (Like global variable). Please help with this! Thank you.
This forum has 173 topics, 516 replies, and was last updated 10 months ago by Ehtesham Abad
Hello Lakshman,
in OpenBots Studio we have support for 2 types of variables: local variables and arguments.
Local Variables: created through the variable pane. Their scope is limited to the script where they are created. Arguments: created through the argument pane. Used to store data dynamically, this data can be passed between obscripts, from one script to another. User is able to set specific direction (In/Out/InOut), that dictates which direction the data will flow.
For instance, if you need a variable to be accessible in Main and all subscripts. You will need to create the variable in main, and pass this to all subscripts as an argument.
Hope this helps!
You are not authorized to reply, please click here to login and add your reply to this topic.