标题:if与select case互换
只看楼主
lele2007
Rank: 5Rank: 5
来 自:广东省深圳
等 级:职业侠客
威 望:6
帖 子:1028
专家分:305
注 册:2007-9-4
结帖率:100%
 问题点数:0 回复次数:3 
if与select case互换
<%
if time >=#6:00:00# and time<=#11:29:00# then
response.write "<span class='lele'> 早上好!今天又是新的开始!加油啊!</span>"
elseif time >=#11:30:00# and time<=#14:30:00# then
response.write "<span class='lele'>中午好!吃饱饭会更有精神哟!</span>"
elseif time >=#14:31:00# and time<=#17:59:00# then
response.write "<span class='lele'>下午好!今天收益还不错吧!努力哟!</span>"
elseif time >=#18:00:00# and time<=#22:00:00# then
response.write "<span class='lele'>晚上好!是时候放松下心情了哟!</span>"
else
response.write "<span class='lele'>夜深了!早点休息注意身体别太晚哟!</span>"
end if
%>
---------------------------------------------------------------------------------------------
<%
dim a
a=time()
select case a
case a >=#6:00:00# and time<=#11:29:00#
response.write "早上好!今天又是新的开始!加油啊"
case a >=#11:30:00# and time<=#14:30:00#
response.write "中午好!吃饱饭会更有精神哟!"
case a >=#14:31:00# and time<=#17:59:00#
response.write "下午好!今天收益还不错吧!努力哟!"
case a >=#18:00:00# and time<=#22:00:00#
response.write "晚上好!是时候放松下心情了哟!"
case else
response.write "夜深了!早点休息注意身体别太晚哟!"
end select
%>

我想问下,怎么if的换成select case的不可以的呢?初学者请问下哪里有错呢?
搜索更多相关主题的帖子: span case select response time 
2008-01-31 11:49
kira007
Rank: 2
等 级:论坛游民
帖 子:294
专家分:27
注 册:2007-6-28
得分:0 
case a >=#6:00:00# and time<=#11:29:00#

case (表达式)  
不跟 判断条件

生活的理想,就是为了理想的生活。
2008-01-31 12:01
lele2007
Rank: 5Rank: 5
来 自:广东省深圳
等 级:职业侠客
威 望:6
帖 子:1028
专家分:305
注 册:2007-9-4
得分:0 
啊?不太明白?那就是说不能用select case来实现那个if语句的功能了?

学习编程www.
2008-01-31 12:15
dhdhzzw
Rank: 1
等 级:新手上路
帖 子:949
专家分:0
注 册:2007-8-13
得分:0 
dim b
b=time()
#6:00:00#<=b<=#11:29:00#
case b
response.write.......

[[it] 本帖最后由 dhdhzzw 于 2008-1-31 12:25 编辑 [/it]]
2008-01-31 12:22



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-199179-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.029372 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved