VB code
dim dic as dictionary
Set dic = New Dictionary
For i = 0 To ubound(a)
If Not dic.Exists(a(i)) Then
dic.Add a(i), vbNullString
Print a(i)
End If
Next
只有一个循环?
请问这位大侠:
要得到dic.Exists(a(i)) 的结果,它不进行循…
[/Quote]
Dictionary 对象与 PERL 关联数组是等价的。(微软原话) 而关联数组,又称为哈希表(hash table),也就是说,dic.Exists(a(i))可以直接定位。
VB code
dim dic as dictionary
Set dic = New Dictionary
For i = 0 To ubound(a)
If Not dic.Exists(a(i)) Then
dic.Add a(i), vbNullString
Print a(i)
End If
Next
只有一个循环?
请问这位大侠:
要得到 dic.Exists(a(i))的结果,它不进行循环吗?
VB code
dim dic as dictionary
Set dic = New Dictionary
For i = 0 To ubound(a)
If Not dic.Exists(a(i)) Then
dic.Add a(i), vbNullString
Print a(i)
End If
Next
VB code
dim dic as dictionary
Set dic = New Dictionary
For i = 0 To ubound(a)
If Not dic.Exists(a(i)) Then
dic.Add a(i), vbNullString
Print a(i)
End If
Next