这个asp的代码哪里错了?放到网页会出错

我的外貌:<%FunctionParseLove(rs,sex)Dimloves,result,comma,currcurr=""result=""comma=""lov... 我的外貌:
<%
Function ParseLove(rs,sex)
Dim loves,result,comma,curr
curr = ""
result = ""
comma = ""
loves = split(rs, ", ")
For i=Lbound(loves) To Ubound(loves)
select case loves(i)
if sex = 1 or sex = "1" then
case "1"
curr = "英俊"
case "2"
curr = "帅气"
case "3"
curr = "健壮"
case else
curr = "帅"
else
case "1"
curr = "美丽"
case "2"
curr = "纯洁"
case "3"
curr = "妩媚"
case else
curr = "可爱"
end if
End Select
result = result & comma & curr
comma = ","
Next
ParseLove = result
End Function
If rs("sex") = 1 or rs("sex") = "1" then
Response.Write(ParseLove(rs("manface"),rs("sex")))
else
Response.Write(ParseLove(rs("womanface"),rs("sex")))
end if
%>

字段manface , womanface 分别是注册的时候提交上来的复选项 1,2,3,4
单独调出一个性别的时候正常。

现在就是加了这个if sex =1 else的判断就出错了,这个判断的代码有问题
2楼的代码放上去,结果

Microsoft VBScript 编译器错误 错误 '800a0400'
缺少语句
/user.asp,行 552

case "1"
^
展开
 我来答
百慕然
2010-12-17 · 超过19用户采纳过TA的回答
知道答主
回答量:128
采纳率:0%
帮助的人:20万
展开全部
<%
Function ParseLove(rs,sex)
Dim loves,result,comma,curr
curr = ""
result = ""
comma = ""
loves = split(rs, ", ")
For i=Lbound(loves) To Ubound(loves)
if sex = 1 or sex = "1" then
select case loves(i)
case "1"
curr = "英俊"
case "2"
curr = "帅气"
case "3"
curr = "健壮"
case else
curr = "帅"
End Select
else
select case loves(i)
case "1"
curr = "美丽"
case "2"
curr = "纯洁"
case "3"
curr = "妩媚"
case else
curr = "可爱"
End Select
end if
result = result & comma & curr
comma = ","
Next
ParseLove = result
End Function
rs=1
sex="1"
If rs = 1 or sex = "1" then
Response.Write(ParseLove(1,1))
else
Response.Write(ParseLove(2,2))
end if
%>
先不调用数据库直接测试,正确,看看读出的值是什么。response。write(“《script》alert('"&rs("值")&"')《/sciprt>”)
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
lnzzxzy
2010-12-16 · TA获得超过8126个赞
知道小有建树答主
回答量:1316
采纳率:80%
帮助的人:745万
展开全部
<%
Function ParseLove(rs,sex)
Dim loves,result,comma,curr
curr = ""
result = ""
comma = ""
loves = split(rs, ", ")
For i=Lbound(loves) To Ubound(loves)
if sex = 1 or sex = "1" then
select case loves(i)
case "1"
curr = "英俊"
case "2"
curr = "帅气"
case "3"
curr = "健壮"
case else
curr = "帅"
End Select
else
select case loves(i)
case "1"
curr = "美丽"
case "2"
curr = "纯洁"
case "3"
curr = "妩媚"
case else
curr = "可爱"
End Select
end if
result = result & comma & curr
comma = ","
Next
ParseLove = result
End Function
If rs("sex") = 1 or rs("sex") = "1" then
Response.Write(ParseLove(rs("manface"),rs("sex")))
else
Response.Write(ParseLove(rs("womanface"),rs("sex")))
end if
%>
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
362366724
2010-12-17 · TA获得超过2498个赞
知道小有建树答主
回答量:784
采纳率:0%
帮助的人:895万
展开全部
<%
Function ParseLove(rs,sex)
Dim loves,result,comma,curr
curr = ""
result = ""
comma = ""
loves = split(rs, ", ")
For i=Lbound(loves) To Ubound(loves)
if sex = 1 or sex = "1" then
select case loves(i)
case "1"
curr = "英俊"
case "2"
curr = "帅气"
case "3"
curr = "健壮"
case else
curr = "帅"
End Select
else
select case loves(i)
case "1"
curr = "美丽"
case "2"
curr = "纯洁"
case "3"
curr = "妩媚"
case else
curr = "可爱"
End Select
end if
result = result & comma & curr
comma = ","
Next
ParseLove = result
End Function
rs=1
sex="1"
If rs = 1 or sex = "1" then
Response.Write(ParseLove(1,1))
else
Response.Write(ParseLove(2,2))
end if
%>
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
ifree2008
2010-12-16 · TA获得超过164个赞
知道小有建树答主
回答量:626
采纳率:0%
帮助的人:516万
展开全部
select 语句不能套 if
select case loves(1)
case "1"
case "2"
end select
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(2)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

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

类别

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

说明

0/200

提交
取消

辅 助

模 式