关于多个case语句同一种处理的问题

freshrabbit 2004-02-12 03:31:54
我想用case语句实现对不同情况的不同处理,可是如果某几种情况都同一种处理怎么办?我这样写没用:

case 1
func1...
case 2
func2...
case 3
case 4
case 5
func3...

请问正确的写法应该是怎样的?
...全文
196 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
UniRyan 2004-09-03
  • 打赏
  • 举报
回复
用case 1,2

/*例*/

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<form name="form1" method="post" action="">
<select name="times" id="times">
<option value="1" <%if request.Form("times")="1" then response.Write "selected"%>>一次</option>
<option value="2" <%if request.Form("times")="2" then response.Write "selected"%> >二次</option>
<option value="3" <%if request.Form("times")="3" then response.Write "selected"%>>三次</option>
<option value="4" <%if request.Form("times")="4" then response.Write "selected"%> >其它</option>
</select>
<input type="submit" name="Submit" value="提交">
</form>
<%
select case cint(request.Form("times"))
case 1
response.write "1111111"
case 2,3
response.write "222233333"
case else
response.write "gogo"
end select

%>


</body>
</html>

28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧