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

来源:百度知道 编辑:UC知道 时间:2024/06/14 07:37:49
asp的if语句的嵌套怎么写,请举例及解释说明

<%
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
%>

简单的: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
resp