如题所述
dim a(3)
for i = 0 to UBound(a)
if IsEmpty(a(i)) then
j = j+1
end if
next
if j = UBound(a)+1 then
msgbox "a("&UBound(a)&")是空数组"
else
msgbox "a("&UBound(a)&")不是空数组"
end if
————————————
用IsEmpty()函数,如果是空数组的话就所有的数组元素都会是空的。
for i = 0 to UBound(a)
if IsEmpty(a(i)) then
j = j+1
end if
next
if j = UBound(a)+1 then
msgbox "a("&UBound(a)&")是空数组"
else
msgbox "a("&UBound(a)&")不是空数组"
end if
————————————
用IsEmpty()函数,如果是空数组的话就所有的数组元素都会是空的。
温馨提示:答案为网友推荐,仅供参考