Count 屬性返回一個(gè)集合或 Dictionary 對(duì)象包含的項(xiàng)目數(shù)。只讀。 object.Count
object 可以是“應(yīng)用于”列表中列出的任何集合或?qū)ο蟮拿Q(chēng)。 說(shuō)明以下代碼舉例說(shuō)明如何使用 Count 屬性: Function ShowKeys
Dim a, d, i, s ' 創(chuàng)建一些變量。
Set d =CreateObject("Scripting.Dictionary") d.Add "a", "Athens" ' 添加一些鍵和項(xiàng)目。
d.Add "b", "Belgrade" d.Add "c", "Cairo" a =d.Keys ' 獲取鍵。
For i =0 To d.Count -1 '重復(fù)數(shù)組。
s =s & a(i) & "<BR>" '創(chuàng)建返回字符串。
Next ShowKeys =sEnd Function
請(qǐng)參閱CompareMode 屬性 | Item 屬性 | Key 屬性 應(yīng)用于:Dictionary 對(duì)象 | Drives 集合 | Files 集合 | Folders 集合 | Matches 集合 返回首頁(yè) |