Implicit Conversion
In this chapter we are going to learn about the Implicit Conversion
Introduction
Rules:
String + Number ---> String # Merge Strings (Number will be converted to a String)
Number + String ---> Number # Sum Numbers (String will be converted to a Number)
We will create a simple program to learn how to use the Implicit Conversion
We can create this program quickly using the Quick Start component
![ib_quickstart_implicitconversion.png](_images/ib_quickstart_implicitconversion.png)
Program Steps
After selecting the (Implicit Conversion) template, we will get the next steps in the Goal Designer
![gd_quickstart_implicitconversion.png](_images/gd_quickstart_implicitconversion.png)
Creating the Program
To create this program we will use the next components
Assignment
Print Text
In the begining the Steps Tree is empty
![1.png](_images/116.png)
Select the (Assignment) component
![2.png](_images/212.png)
Enter the data in the Interaction Page
Left side: x
Right side: 10
![3.png](_images/36.png)
The Steps Tree will be updated
![4.png](_images/44.png)
Set y = “20”
![5.png](_images/54.png)
![6.png](_images/64.png)
The Steps Tree will be updated
![7.png](_images/74.png)
Set sum = x + y
X is a Number
Y is a String
X + Y —> Number + String —> Number
![8.png](_images/84.png)
![9.png](_images/94.png)
![10.png](_images/104.png)
Set msg = “Sum = ” + sum
“Sum = ” is a String
sum is a Number
“Sum = ” + sum —> String + Number —> String
![11.png](_images/117.png)
![12.png](_images/124.png)
![13.png](_images/134.png)
Print the Msg variable
![14.png](_images/144.png)
![15.png](_images/154.png)
Now we have the final Steps Tree in our program
![16.png](_images/164.png)