Visual Basic Scripting Edition | 語言參考 |
Items 方法返回一個(gè)數(shù)組,其中包含有 Dictionary 對象中的所有項(xiàng)目。 object.Items
object 應(yīng)為 Dictionary 對象的名稱。 說明以下代碼舉例說明如何使用 Items 方法: Function DicDemo
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.Items ' 獲取項(xiàng)目。
For i =0 To d.Count -1 ' 循環(huán)使用數(shù)組。
s =s & a(i) & "<BR>" ' 創(chuàng)建返回字符串。 Next DicDemo =s End Function
請參閱Add 方法(Dictionary) | Exists 方法 | Keys 方法 | Remove 方法 | RemoveAll 方法 應(yīng)用于: Dictionary 對象 返回首頁 |