RosettaCodeData/Task/Associative-array-Iteration/VBScript/associative-array-iteration.vb
2023-07-01 11:58:00 -04:00

12 lines
294 B
VB.net

'instantiate the dictionary object
Set dict = CreateObject("Scripting.Dictionary")
'populate the dictionary or hash table
dict.Add 1,"larry"
dict.Add 2,"curly"
dict.Add 3,"moe"
'iterate key and value pairs
For Each key In dict.Keys
WScript.StdOut.WriteLine key & " - " & dict.Item(key)
Next