If you save a dictionary object at the session level, it will reduce the performance of the system, while saving a dictionary object at the application level will cause the web server to crash. I won't say much about this.
What we need to consider now is what design defects are there when dictionary objects on a single page:
You can try this
set rs=("")
sql="select * from table"
sql,conn,1,3
set ttt=("")
"xxx",rs("field")
set rs=nothing
liu=ttt("xxx") 'What will you find when you do this? The asp page will tell you that an accident has occurred! ! ! This is very surprising. What is an accident? It is hard to say that after repeated tests, I found that the value of rs("field") cannot be directly used to the dictionary object. After repeated research, the conclusion is as follows: dictionary stores the memory address of rs("field"). In this way, the one I just wrote is undoubtedly a disaster. The solution is to put this rs("field") into a variable to solve it, but can't the dictionary object save an object that has been nothing? This is a big question, so I wrote another program, you can save it to see the effect
<script language='vbscript'>
set ttt=createobject("")
"liu","uuu"
set ddd=createobject("")
"ppp",ttt
set ttt=nothing
bbb=ddd("ppp")("liu")
alert(bbb)
</script>
What is the result? You will find that there is no problem with a paragraph alert uuu, which means that the dictionary object is actually the other
The entire dictionary object came in, which further verified the dictionary object written in wrox's book. When the dictionary object was developed, it was found that it was not available.
It's actually aimed at the client, this is the statement
There are also codes used for arrays and dictionary.
<script language='vbscript'>
i=1
picname=("xxx")
str="set " & "pic_" & i & "=createobject(" & """" & "" & """" & ")"
execute(str)
str="pic_" & i & ".add " & """" & "picname" & """" & "," & """" & picname & """"
execute(str)
dim ttt()
redim ttt(5)
ttt(0)="uuu"
pic_1.add "item",ttt
liu=pic_1("picname")
set pic_2=createobject("")
erase ttt
redim ttt(5)
ttt(0)="iii"
nnn=pic_1("item")(0)
pic_2.add "rrr",ttt
zzz=pic_2("rrr")(0)
alert(liu)
alert(nnn)
alert(zzz)
</script>
What we need to consider now is what design defects are there when dictionary objects on a single page:
You can try this
set rs=("")
sql="select * from table"
sql,conn,1,3
set ttt=("")
"xxx",rs("field")
set rs=nothing
liu=ttt("xxx") 'What will you find when you do this? The asp page will tell you that an accident has occurred! ! ! This is very surprising. What is an accident? It is hard to say that after repeated tests, I found that the value of rs("field") cannot be directly used to the dictionary object. After repeated research, the conclusion is as follows: dictionary stores the memory address of rs("field"). In this way, the one I just wrote is undoubtedly a disaster. The solution is to put this rs("field") into a variable to solve it, but can't the dictionary object save an object that has been nothing? This is a big question, so I wrote another program, you can save it to see the effect
<script language='vbscript'>
set ttt=createobject("")
"liu","uuu"
set ddd=createobject("")
"ppp",ttt
set ttt=nothing
bbb=ddd("ppp")("liu")
alert(bbb)
</script>
What is the result? You will find that there is no problem with a paragraph alert uuu, which means that the dictionary object is actually the other
The entire dictionary object came in, which further verified the dictionary object written in wrox's book. When the dictionary object was developed, it was found that it was not available.
It's actually aimed at the client, this is the statement
There are also codes used for arrays and dictionary.
<script language='vbscript'>
i=1
picname=("xxx")
str="set " & "pic_" & i & "=createobject(" & """" & "" & """" & ")"
execute(str)
str="pic_" & i & ".add " & """" & "picname" & """" & "," & """" & picname & """"
execute(str)
dim ttt()
redim ttt(5)
ttt(0)="uuu"
pic_1.add "item",ttt
liu=pic_1("picname")
set pic_2=createobject("")
erase ttt
redim ttt(5)
ttt(0)="iii"
nnn=pic_1("item")(0)
pic_2.add "rrr",ttt
zzz=pic_2("rrr")(0)
alert(liu)
alert(nnn)
alert(zzz)
</script>