主题:关于ListBox的问题
在某文件夹下,有一个avi文件,在我这个Function执行的时候,在Listbox中,会反复添加几次这个AVi文件的路径,其它的文件也是一样!
但是,在我把
If qq = "mp3" Then
List1.AddItem pathi & name
后面的elseif代码删掉后,又恢复正常了,请高手指教!是不是If中OR的使用失误?
Function kzm(name)
Dim qq As String
Dim qs As Long
qs = InStrRev(name, ".")
If qs = 0 Then
Exit Function
Else
qq = Mid(name, qs + 1, Len(name) - qs)
If qq = "mp3" Then
List1.AddItem pathi & name
ElseIf qq = "wmv" Then
MsgBox "Add mp3"
List1.AddItem pathi & name
ElseIf qq = "avi" Then
MsgBox "Add mp3"
List1.AddItem pathi & name
ElseIf qq = "wma" Then
List1.AddItem pathi & name
ElseIf qq = "wav" Then
List1.AddItem pathi & name
Else
End If
kzm = qq
End If
qq = ""
End Function
但是,在我把
If qq = "mp3" Then
List1.AddItem pathi & name
后面的elseif代码删掉后,又恢复正常了,请高手指教!是不是If中OR的使用失误?
Function kzm(name)
Dim qq As String
Dim qs As Long
qs = InStrRev(name, ".")
If qs = 0 Then
Exit Function
Else
qq = Mid(name, qs + 1, Len(name) - qs)
If qq = "mp3" Then
List1.AddItem pathi & name
ElseIf qq = "wmv" Then
MsgBox "Add mp3"
List1.AddItem pathi & name
ElseIf qq = "avi" Then
MsgBox "Add mp3"
List1.AddItem pathi & name
ElseIf qq = "wma" Then
List1.AddItem pathi & name
ElseIf qq = "wav" Then
List1.AddItem pathi & name
Else
End If
kzm = qq
End If
qq = ""
End Function