1. How to create the scripting object?
Set dic=Server.CreateObject("Scripting>Dictionary")
2. How to add data into this dictionary?
dic.add("regn-no:234","Donbergs")
3. In the above line, which one is the KEY and which one is ITEM?
regn-no:234 is the key. It is just like primary key. It should be unique.
"Donbergs" is the item or value.
3. How to get back the value of " regn-no:234" again?
x="regn-no:234"
y=dic.item(x)
4. How to change the value of the key "regn-no:234" ?
dic.item("regn-no:234")="Donbergs Peter"
5. How to change the key for the value "Donbergs"?
dic.key("Donbergs")="regn-no:999"
6. I want to display the value ONLY IF THE RECORD EXISTS. How to do it?
If dic.Exists("regn-no:234") Then
Response.write(dic.item("regn-no:234")
note; scripting dictionary is just like a two-dimentional array:
scrpting dictionary is just like a small table having only two fields.
The scripting dictionary looks like this:
KEY ITEM
-----------------
23 Ramesh
35 Peter
40 Sam
You can add,edit,delete and view the items in this dictionary
Where scripting.dictionary will be used/
For example, if you want to create a table during the intial stage of a program.
Then, use this table in the middle
And finally delete the table.