asp的if语句的嵌套怎么写,请举例说明 10

asp的if语句的嵌套怎么写,请举例及解释说明... asp的if语句的嵌套怎么写,请举例及解释说明 展开
 我来答
小刚爱生活
2009-05-11 · TA获得超过1025个赞
知道大有可为答主
回答量:2140
采纳率:100%
帮助的人:732万
展开全部
简单的:if 5>4 then response.write "5大于4"

常规的:
if 5>4 then
response.write "5大于4"
else
response.write "5小于4"
end if

多个条件:
if 5>5 then
response.write "5大于5"
elseif 5=5 then
response.write "5等于5"
else
response.write "5小于5"
end if

嵌套的话把 其中的一个 response.write 换成一个
if * then
*
else
end if
即可
-------------
a=5
if a>0 then
if a=5 then
response.write "a等于5"
else
response.write "a不等于5"
end if
else
response.write "a小于0"
end if
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
lzp4881
推荐于2016-09-25 · TA获得超过2394个赞
知道大有可为答主
回答量:2825
采纳率:0%
帮助的人:3366万
展开全部
<%
thetime=hour(time)

if thetime=>0 and thetime<6 then
str="凌晨好"
elseif thetime>=6 and thetime<12 then
str="上午好"
elseif thetime=>12 and thetime<14 then
str="中午好"
elseif thetime=>14 and thetime<19 then
str="下午好"
elseif thetime=>19 then
str="晚上好"
end if

response.write str
%>
本回答被网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
後的小青年ck
2009-05-11 · TA获得超过833个赞
知道小有建树答主
回答量:1033
采纳率:0%
帮助的人:892万
展开全部
If 变量=值 Then
If 变量=值 Then
执行语句
Else
执行语句
End If
Else
执行语句
End If
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
班丘皖静0ay
2009-05-11 · TA获得超过2645个赞
知道小有建树答主
回答量:1528
采纳率:55%
帮助的人:978万
展开全部
If 条件 Then
If 条件 Then
语句
Else
语句
End If

If 条件 Then
语句
Else
语句
End If

Elseif 条件 Then
语句
else

语句
End If
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
百度网友e03dfa421
2009-05-11 · TA获得超过239个赞
知道小有建树答主
回答量:374
采纳率:0%
帮助的人:208万
展开全部
<%
if i>5 then
if i=4 then
输出
end if
输出
elseif i>3 and i<5 then
输出
end if
%>
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(4)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

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

类别

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

说明

0/200

提交
取消

辅 助

模 式