Category Archive: Dictionary

Sep 01 2008

Complex Dictionary Usage

In this article we are about to see the efficiency of a dictionary when checking or retrieving values from a web-table, For this purpose we have the following table in our AUT. This is the script that will parse the table and will upload the dictionary. After running the script above, the solarExch dictionary loaded …

Continue reading »

Apr 01 2008

Add Elements to a Dictionary

Demonstration script that adds three key-item pairs to a Script Runtime Dictionary. Script must be run on the local computer. Set oDictionary = CreateObject(“Scripting.Dictionary”) oDictionary.Add “Printer 1″, “Printing” oDictionary.Add “Printer 2″, “Offline” oDictionary.Add “Printer 3″, “Printing”

Apr 01 2008

Delete All Elements from a Dictionary

Demonstration script that deletes all the key-item pairs from a Script Runtime Dictionary. Script must be run on the local computer Set oDictionary = CreateObject(“Scripting.Dictionary”) oDictionary.Add “Printer 1″, “Printing” oDictionary.Add “Printer 2″, “Offline” oDictionary.Add “Printer 3″, “Printing” keysCol = oDictionary.Keys Print “First run: ” For Each KeyStr in keysCol Print KeyStr Next oDictionary.RemoveAll keysCol = …

Continue reading »

Apr 01 2008

Delete One Element from a Dictionary

Demonstration script that deletes a specific key-item pair from a Script Runtime Dictionary. Script must be run on the local computer. Set oDictionary = CreateObject(“Scripting.Dictionary”) oDictionary.Add “Printer 1″, “Printing” oDictionary.Add “Printer 2″, “Offline” oDictionary.Add “Printer 3″, “Printing” keysCol = oDictionary.Keys Print “First run: ” For Each keyStr in keysCol Print keyStr Next oDictionary.Remove(“Printer 2″) keysCol= …

Continue reading »

Apr 01 2008

List the Number of Items in a Dictionary

Demonstration script that counts the number of key-item pairs in a Script Runtime Dictionary. Script must be run on the local computer. Set oDictionary = CreateObject(“Scripting.Dictionary”) oDictionary.Add “Printer 1″, “Printing” oDictionary.Add “Printer 2″, “Offline” oDictionary.Add “Printer 3″, “Printing” Print objDictionary.Count

Apr 01 2008

Verify the Existence of a Dictionary Key

Demonstration script that verifies the existence of a particular key within a Script Runtime Dictionary. Script must be run on the local computer. Set oDictionary = CreateObject(“Scripting.Dictionary”) oDictionary.Add “Printer 1″, “Printing” oDictionary.Add “Printer 2″, “Offline” oDictionary.Add “Printer 3″, “Printing” If oDictionary.Exists(“Printer 4″) Then Print “Printer 4 is in the Dictionary.” Else Print “Printer 4 is …

Continue reading »