Why does this code
produce this output:
[tt]RegValues.Count -1 = 2
i = '0'
""
i = '1'
""
i = '2'
""[/tt]
when I'd have expected it to produce something like:
[tt]RegValues.Count -1 = 2
i = '0'
"a"
i = '1'
"b"
i = '2'
"b"[/tt]
My code is based upon code I got off t'internet so I've clearly edited it incorrectly...
Can someone help me understand how to manipulate the values stored in the Dictionary so I can do whatever I like with them, please?
JJ
[small][purple]Variables won't. Constants aren't[/purple][/small]
Code:
Dim RegValue, RegValues, i 'Create some variables
Set RegValues = CreateObject("Scripting.Dictionary")
RegValues.Add "a", "Athens" 'Add some keys and items.
RegValues.Add "b", "Belgrade"
RegValues.Add "c", "Cairo"
RegValue = RegValues.keys 'Get the keys
wscript.echo "RegValues.Count -1 = " & RegValues.Count -1
For i = 0 To RegValues.Count -1 'Iterate the array
wscript.echo "i = '" & i & "'" & vbCrLf & """" & RegValues(i) & """" 'Print key
Next
[tt]RegValues.Count -1 = 2
i = '0'
""
i = '1'
""
i = '2'
""[/tt]
when I'd have expected it to produce something like:
[tt]RegValues.Count -1 = 2
i = '0'
"a"
i = '1'
"b"
i = '2'
"b"[/tt]
My code is based upon code I got off t'internet so I've clearly edited it incorrectly...
Can someone help me understand how to manipulate the values stored in the Dictionary so I can do whatever I like with them, please?
JJ
[small][purple]Variables won't. Constants aren't[/purple][/small]