vb判斷數組?
一: 利用錯誤捕獲功能判斷
Dim ArrayS() As String
Private Sub Command1_Click()
On Error GoTo z
If UBound(ArrayS) > -1 Then
MsgBox "數組不為空"
End If
z:
MsgBox "數組空"
End Sub
二、 Join方法:
Dim ArrayS() As String
Private Sub Command1_Click()
If (CStr(Join(ArrayS, ""))) = "" Then
MsgBox "為空"
Else
MsgBox "不為空"
End If
End Sub