Author Topic: IDictionary.Count Property  (Read 3163 times)

0 Members and 1 Guest are viewing this topic.

Online José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2517
  • User-Rate: +209/-0
  • Gender: Male
IDictionary.Count Property
« on: July 13, 2008, 10:32:54 PM »

The following example illustrates the use of the Count property.

Code: [Select]
#INCLUDE "windows.inc"
#INCLUDE "scrrun.inc"

DIM pDic AS IDictionary
DIM vKey AS VARIANT
DIM vItem AS VARIANT
DIM nCount AS LONG

' Create an instance of the Dictionaty object
pDic = NEWCOM "Scripting.Dictionary"
' Add some key/item pairs to the dictionary
vKey = "a" : vItem = "Athens"
pDic.Add vKey, vItem
vKey = "b" : vItem = "Belgrade"
pDic.Add vKey, vItem
vKey = "c" : vItem = "Cairo"
pDic.Add vKey, vItem
' Retrieve the number of items in the collection
nCount = pDic.Count
« Last Edit: July 13, 2008, 10:55:48 PM by José Roca »