|
if 语句使用示例:<html>
<body>
<%
dim a, b
a = 2
b = 1
if a = 1 and b = 1 then
response.Write("今天有促销信息")
else
response.Write("今天没有促销信息")
end if
%>
</body>
</html> 输出:今天没有促销信息 。
可以使用 if not :<html>
<body>
<%
dim a, b
a = 2
b = 1
if not a = 1 and b = 1 then
response.Write("今天有促销信息")
else
response.Write("今天没有促销信息")
end if
%>
</body>
</html> 输出:今天有促销信息。
使用 elseif :<html>
<body>
<%
dim a, b
a = 50
b = 80
if a > 100 then
response.Write("今天有促销信息")
elseif b > 70 then
response.Write("今天有促销信息")
else
response.Write("今天没有促销信息")
end if
%>
</body>
</html> 输出:今天有促销信息。
注意:if 和 elseif 后面的 then 不要漏掉。 |
|