定义简单变量:<
br
/>
<
z:set
var
=
"count"
value
=
"12"
/>
<
z:set
var
=
"price"
value
=
"2.1"
/>
输出count值:${count}<
br
/>
输出count*price值:${count*price}<
br
/>
<
br
/>
修改简单变量:<
br
/>
<
z:set
var
=
"price"
value
=
"2.2"
/>
再次输出count*price值:${count*price}<
br
/>
<
br
/>
<
br
/>
定义对象:<
br
/>
<
z:set
var
=
"zving"
json
=
"{name:'泽元软件',postcode:'100085','test?':'特殊字符'}"
/>
输出zving.name:${zving.name}<
br
/>
输出zving.postcode:${zving.postcode}<
br
/>
输出属性中含有特殊字符的值:${zving['test?']}<
br
/>
修改对象值:<
br
/>
<
z:set
var
=
"zving.name"
value
=
"泽元软件有限公司"
/>
再次输出zving.name:${zving.name}<
br
/>
<
br
/>
<
br
/>
定义列表:<
br
/>
<
z:set
var
=
"list"
json
=
"['A','B','C','D']"
/>
输出列表中的值:${list[1]}
<
br
/>
修改列表:
<
z:set
var
=
"list[1]"
value
=
"BB"
/>
再次输出列表中的值:${list[1]}
注意:
<
z:set
>也可以改变全局变量的值,例如:
<
z:set
var
=
"Request.PageIndex"
value
=
"1"
/>