Dynamic Loop
In this chapter we are going to create the Dynamic Loop sample
Introduction
We can create this program quickly using the Quick Start component
![ib_quickstart_dynamicloop.png](_images/ib_quickstart_dynamicloop.png)
Program Steps
After selecting the (Dynamic Loop) template, we will get the next steps in the Goal Designer
![gd_quickstart_dynamicloop.png](_images/gd_quickstart_dynamicloop.png)
Creating the Program
To create this program we will use the next components
Print Text
Get Input
Assignment
For Loop
Note
This example uses the Assignment component to convert Strings to Numbers, but we can just let the Get Input component do the conversion for us.
In the begining the Steps Tree is empty
![1.png](_images/112.png)
Select the (Print Text) component
![2.png](_images/26.png)
Enter the data in the Interaction Page
Text: Start :
Type: Literal
![3.png](_images/32.png)
The Steps Tree will be updated
![4.png](_images/42.png)
Select the (Get Input) component
![5.png](_images/52.png)
The variable name will be (nStart)
![6.png](_images/62.png)
The Steps Tree will be updated
![7.png](_images/72.png)
Print (End : )
![8.png](_images/82.png)
![9.png](_images/92.png)
![10.png](_images/102.png)
Use the (Get Input) component
![11.png](_images/113.png)
The variable name will be (nEnd)
![12.png](_images/122.png)
The Steps Tree will be updated
![13.png](_images/132.png)
Print (Step : )
![14.png](_images/142.png)
![15.png](_images/152.png)
![16.png](_images/162.png)
Use the (Get Input) component
![17.png](_images/172.png)
The variable name will be (nStep)
![18.png](_images/182.png)
![19.png](_images/192.png)
Convert the variables (nStart, nEnd and nStep) from String to Number
Use the (Assignment) component
![20.png](_images/201.png)
Convert the variable (nStart) from String to Number
![21.png](_images/211.png)
![22.png](_images/221.png)
Use the (Assignment) component
![23.png](_images/231.png)
Convert the variable (nEnd) from String to Number
![24.png](_images/241.png)
![25.png](_images/251.png)
Use the (Assignment) component
![26.png](_images/261.png)
Convert the variable (nStep) from String to Number
![27.png](_images/27.png)
![28.png](_images/28.png)
Select the (For Loop) component
![29.png](_images/29.png)
Enter the data in the Interaction Page
Start: x = nStart End: nEnd Step: nStep
![30.png](_images/30.png)
![31.png](_images/311.png)
Use the (Print Text) component to print the number
![32.png](_images/321.png)
![33.png](_images/33.png)
Now we have the final Steps Tree in our program
![34.png](_images/34.png)