Jump to content

Associative array/Iteration: Difference between revisions

m (→‎{{header|NetRexx}}: remove savelog)
Line 2,465:
1.620000
3.140000
</pre>
 
=={{header|VBScript}}==
<lang vb>
'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
</lang>
 
{{Out}}
<pre>
1 - larry
2 - curly
3 - moe
</pre>
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.