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 %>
新手 我想弄个循环 十几个部门呢 求详解 展开
<% 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 %>
新手 我想弄个循环 十几个部门呢 求详解 展开
1个回答
展开全部
<%
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
%>
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
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询