vs code使用教程(vl函数怎么用)
2022-08-27 11:39:40
摘要: vs code使用教程(vl函数怎么用)...
将由数字符号(包括正负号、小数点)组成的字符型数据转换成相应的数值型数据。
格式
使用格式用法:Val(S,V,Code)
text1.text = "10"
text2.text = "11"
text3.text = text1.text+text2.text
按道理应该得到10+11(结果是21),但返回的是1011,这个是因为运算时候是字符运算。
text1.text = "10"
text2.text = "11"
text3.text = val(text1.text)+val(text2.text)
返回的就是21。