p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: Seeking advice re: two-dimensional scripting dictionary


Message #1 by "cb" <wrox@e...> on Thu, 7 Mar 2002 07:02:28
The following code actually works in asp:

dim twoDimDict
set twoDimDict=server.createobject("Scripting.Dictionary")
twoDimDict("kkey") = array("a","b","c")
response.write twoDimDict("kkey")(0)

Output is a, as expected.

It's almost like being back in perlville. But the following does not work:

twoDimDict("kkey")(2) = "d"

This statement does not give an error, but it also does not change the 
value retrieved from twoDimDict("kkey")(2). (Using the more formal syntax, 
with .add and .item seems to make no difference.)

So I wonder -- is using dictionaries this way pushing vbscript too far? If 
not, is there a way to change the value of one element of an array stored 
in a dictionary item?

  Return to Index