Saturday, 30 May 2020

VBScript: How to use Dictionary in VBScript | VBScript objects

=>To declare and create object of a vbscript dictionary:

Dim objDictionary
Set objDictionary = CreateObject("Scripting.Dictionary")


=>To add key and items into Dictionary

objDictionary.Add "1stKey", "Apple"
objDictionary.Add "2ndKey", "Ball"


=>To get count of items in dictionary

count= objDictionary.Count



=>To retrieve a item value from VBDictionary using key

msgbox objDictionary.item("1stkey")



=>To remove item use this below method

objDictionary.Remove("1stKey")


=>To remove all items or erase contents of vbDictionary

objDictionary.RemoveAll()


No comments:

Post a Comment

VBScript: How to use Dictionary in VBScript | VBScript objects

=>To declare and create object of a vbscript dictionary: Dim objDictionary Set objDictionary = CreateObject("Scripting.Dictionar...