怎么相加就等于11了?Dim a, b, c, d, e As Integer

日期:2012-03-17 20:39:58 人气:1

怎么相加就等于11了?Dim a, b, c, d, e As Integer

问题出在变量声明上,你应该像下面这们声明: Dim a As Integer,b As Integer,c As Integer,d As Integer,e As Integer 至于为什么是等于11,那跟变量类型有关系: Dim a, b, c, d, e As Integer 这个声明只有e是Integer整型, a,b,c,d都是变体类型,因此a=Text1.text使a="1",注意,是字符串"1“而不是数字1. 于是e=a+b其实就是e=a & b,即
    A+
热门评论