条件语句之 select case  语句
一、多条件分支的时候优先使用select case结构;
      二、数字的大量列举时最好使用select case
      三、必须使用 end select 来结束分支结构
示例:
如下为引用内容:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> 条件语句之 select case  语句 </title>
</head>
<body>
<%
dim a          '声明一个变量
a=6             '给变量赋值
select case a
case 1,2,3,4
response.Write "循环语句"
case 5,6,7,8
response.Write "条件语句"
end select
%>
</body>
</html>
运行结果:条件语句










以上就是ASP基础入门——条件语句之 select case语句用法和格式的详细内容,更多信息请关注OD云其它相关文章!



本文URL:http://www.odweb.cn/news_show.html?id=174