VB代码问题~~

来源:百度知道 编辑:UC知道 时间:2024/06/08 05:56:37
<%
arrServiceShow=split(ServiceShow,",")
i=0
For each i in arrServiceShow
IF trim(arrServiceShow(i))=1 THEN
ServiceS="茶"
ELSEIF trim(arrServiceShow(i))=2 THEN
ServiceS="饮料"
ELSEIF trim(arrServiceShow(i))=3 THEN
ServiceS="点心"
ELSEIF trim(arrServiceShow(i))=4 THEN
ServiceS="水果"
ELSEIF trim(arrServiceShow(i))=5 THEN
ServiceS="电视机"
ELSEIF trim(arrServiceShow(i))=6 THEN
ServiceS="商场广播"
ELSEIF trim(arrServiceShow(i))=7 THEN
ServiceS="话筒"
ELSEIF trim(arrServiceShow(i))=8 THEN
ServiceS="纸杯"
ELSEIF trim(arrServiceShow(i))=9 THEN
ServiceS="投影仪"
ELSEIF trim(arrServiceShow(i))=10 THEN
ServiceS="书刊杂志"
ELSEIF trim(arrServiceShow(i))=11 THEN
ServiceS="改变沙发位置"
END IF
ServiceSh=ServiceSh&","&ServiceS
next
IF(

把trim(arrServiceShow(i)) 换成i
Foreach i 的i 就是arrServiceShow的元素了,不是它的索引,所以直接用i 就行了

ServiceSh=ServiceSh & "," & ServiceS

ServiceSh=ServiceSh&","&ServiceS
&符号前后都要有一个空格