ASP:True or False,明明白白你的If语句流程
if condition then
[statements1]
else
[statements2]
end if
上边是vbscript脚本if语句的语法,当condition值为true时执行statements1,当condition值为false时执行statements2,由于vbscript的类型自动转换功能,当condition的值为非0的数值时和true等效,当condition的值为0时和false等效。
实际运用中,我们必须对condition的值有充分的认识,才能对if语句的流程胸有成足。下边我们再举一些例子来加深记忆:
<%
dim condition
condition = response.isclientconnected
if condition then
response.write("true")
else
response.write("false")
end if
condition = true , result:true
condition = false , result:false
condition = 2 , result:true
condition = 0.01 , result:true
condition = 0 , result:false
condition = 0.00 , result:false
condition = isnumeric(3) , result:true
condition = isnumeric("aa") , result:false
condition = array(0,1,"aa","bb")(0) , result:false
condition = array(0,1,"aa","bb")(1) , result:true
condition = response.isclientconnected , result:true
%>
上一篇: Vuex模块化实现待办事项的状态管理
下一篇: 第一个博客_测试用