ASP 循环语句中 字符串变量的问题

如下<%ttcv="政治处"ifshow.Fields.Item(ttcv).Value="N"thenelseifusers.Fields.Item("add").Va... 如下
<% ttcv="政治处"
if show.Fields.Item(ttcv).Value="N" then
elseif users.Fields.Item("add").Value=ttcv and show.Fields.Item(ttcv).Value="Y" then
response.write(ttcv)
response.write("<a href=/T_qs/"& users.Fields.Item("add").Value &".asp?no="& (show.Fields.Item("no").Value) & " >点此签收</a>")
elseif users.Fields.Item("add").Value<>ttcv and show.Fields.Item(ttcv).Value="Y"then
response.write(ttcv)
else
response.write(ttcv)
response.write((show.Fields.Item(ttcv).Value))
end if %>
<% ttcv="督察"
if show.Fields.Item(ttcv).Value="N" then
elseif users.Fields.Item("add").Value=ttcv and show.Fields.Item(ttcv).Value="Y" then
response.write(ttcv)
response.write("<a href=/T_qs/"& users.Fields.Item("add").Value &".asp?no="& (show.Fields.Item("no").Value) & " >点此签收</a>")
elseif users.Fields.Item("add").Value<>ttcv and show.Fields.Item(ttcv).Value="Y"then
response.write(ttcv)
else
response.write(ttcv)
response.write((show.Fields.Item(ttcv).Value))
end if %>
新手 我想弄个循环 十几个部门呢 求详解
展开
 我来答
酒瓶里的蚊子
2015-02-08 · TA获得超过622个赞
知道小有建树答主
回答量:629
采纳率:0%
帮助的人:779万
展开全部
<%
Dim ttcv_ListStr,ttcv_ListArray
ttcv_ListStr="政治处,督察,装备处,法制处,指挥中心"
ttcv_ListArray=Split(ttcv_ListStr,",")
For i =0 to Ubound(ttcv_ListArray)
QianShou(ttcv_ListArray(i))
Next

Sub QianShou(DpName)
ttcv=DpName
‘以下部分来自你原来的代码
if show.Fields.Item(ttcv).Value="N" then
elseif users.Fields.Item("add").Value=ttcv and show.Fields.Item(ttcv).Value="Y" then
response.write(ttcv)
response.write("<a href=/T_qs/"& users.Fields.Item("add").Value &".asp?no="& (show.Fields.Item("no").Value) & " >点此签收</a>")
elseif users.Fields.Item("add").Value<>ttcv and show.Fields.Item(ttcv).Value="Y"then
response.write(ttcv)
else
response.write(ttcv)
response.write((show.Fields.Item(ttcv).Value))
end if

End Sub
%>
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式