当前位置: 首页 > 图文教程 > 网络编程 > ASP > ASP:True or False,明明白白你的If语句流程

ASP
FrontPage 2000+DB2实现数据库信息发布
Execel文件插入到ASP页面
利用ASP在客户端注册DLL文件
1栏分页显示(附显示的形式前页,后页)
1栏分页显示(附显示的形式[1][2])
一个基于web的QQ程序 2(xml+asp)
XMLHTTP+javascript+Asp写得聊天室,无刷新实现(一)
XMLHTTP+javascript+Asp写得聊天室,无刷新实现(二)
XMLHTTP+javascript+Asp写得聊天室,无刷新实现(三)
XMLHTTP+javascript+Asp写得聊天室,无刷新实现(四)
XMLHTTP+javascript+Asp写得聊天室,无刷新实现(五)
XMLHTTP+javascript+Asp写得聊天室,无刷新实现(六)
建立一个广告交换及跟踪系统
如何制作无状态的ASP组件
无组件文件上传代码实例
建立动态下拉式选单(三阶层)
用ASP编写的“俄罗斯方块游戏”
利用ASP.NET来访问Excel文档
初探SSI网页制作
具有自攻击性的代码

ASP:True or False,明明白白你的If语句流程


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-14   浏览: 80 ::
收藏到网摘: n/a

通过学习ASP明明白白你的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
%>