Variables Scope
In this chapter we are going to learn about the Variables Scope
Introduction
We can create this program quickly using the Quick Start component
![ib_quickstart_variablesscope.png](_images/ib_quickstart_variablesscope.png)
Program Steps
After selecting the (Variables Scope) template, we will get the next steps in the Goal Designer
![gd_quickstart_variablesscope.png](_images/gd_quickstart_variablesscope.png)
Creating the Program
To create this program we will use the next components
Assignment
Define Function
Call Function
For Loop
Print Text
In the begining the Steps Tree is empty
![1.png](_images/180.png)
Set x=10 using the Assignment component
![2.png](_images/230.png)
![3.png](_images/328.png)
![4.png](_images/426.png)
Define the Main() function
![5.png](_images/518.png)
![6.png](_images/614.png)
![7.png](_images/714.png)
Count from 1 to 10 using a For Loop
![8.png](_images/814.png)
![9.png](_images/914.png)
![10.png](_images/1014.png)
Call the mycounter() function
![11.png](_images/1118.png)
![12.png](_images/1216.png)
![13.png](_images/1315.png)
Define the mycounter() function
![14.png](_images/1413.png)
![15.png](_images/1513.png)
![16.png](_images/1613.png)
Print the X variable
![17.png](_images/1710.png)
![18.png](_images/189.png)
![19.png](_images/199.png)
Decrement the X value
![20.png](_images/208.png)
![21.png](_images/2113.png)
Now we have the final Steps Tree in our program
![22.png](_images/2211.png)