ASP條件語句之select case語句

條件語句之 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>
運行結果:條件語句
相關文章
相關標籤/搜索