Yojo网页设计

首页 新闻中心 网页教程 图形图像 设计欣赏 编程开发 程序教程 网站运营 数据库教程
·ASP教程·ASP.net教程·PHP教程·JSP教程·编程杂谈·AJAX·XML

您现在的位置: yojo网页设计 >> 编程开发 >> ASP教程 >> 正文

 

学习ASP If语句流程

更新时间:2007-11-18 19:32:54 文章来源:互联网 .

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
%>


点击: 文章地址:http://www.518web.net/bckf/asp/10524.html

热门点击

友情链接首页文字链接要求:PR≥4,搜索引擎正常收录,开通一年以上,内容健康充实的站点!申请...

Copyright(C) 2005-2008 518web.net,All Rights Reserve
Email:yojo.x@msn.com | 在线QQ:2306380 53614197| [浙ICP备08009643号]