Usage of + operator in differents situations in vbscript
<p>What is the Value of the below in vbscript</p>

<p><code>1)x=1+"1"
 2)x="1"+"1"
 3)x=1+"mulla"</code>
Note:In the all above three cases I am using first variable as either string or integer and second on as always as string.</p>

<p>Case 1:Acting as a numeric and auto conversion to numeric during operation</p>

<pre><code>enter code here
y=inputbox("Enter a numeric value","") Rem I am using 1 as input
x=1
msgbox x+y Rem value is 2
msgbox x*y Rem value is 1
</code></pre>

<p>Case 2:Acting as a String and no conversion to numeric during operation it fails</p>

<pre><code>enter code here
y=inputbox("Enter a numeric value","") Rem I am using 1 as input
x=1
if y= x then
    msgbox "pass"
else
    msgbox "fail"
end if
</code></pre>

<p>Case 3:Acting as a String and explicit conversion to numeric during operation it passes</p>

<pre><code>enter code here
y=inputbox("Enter a numeric value","") Rem I am using 1 as input
x=1
if Cint(y) = x then
    msgbox "pass"
else
    msgbox "fail"
end if
</code></pre>

<p>I need a logic reason for the different behaviors. but in other language it is straight forward and will work as expected</p>