vbscript中下面的值是什么
1)x=1+"1"
2)x="1"+"1"
3)x=1+"mulla"
注意:在以上三种情况下,我使用第一个变量作为字符串或整数,第二个变量一如既往地作为字符串。
案例1:作为数值,在运行过程中自动转换为数值
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
案例2:作为字符串,在操作过程中不转换为数字失败
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
案例3:作为一个字符串,在它通过的操作过程中显式转换为数字
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
我需要不同行为的逻辑原因。但在其他语言中,它是直截了当的,并且会按预期工作