用户名: 密码: 验证码:           网站地图 高级搜索 RSS订阅 收藏本站
Google
您的位置:首页>>网络编程>>ASP编程>>阅读资讯:ASP:True or False,明明白白你的If语句流程

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

[ 来源: | 阅读:次 | 更新日期:2007-10-6 14:41:49 | 评论 0 条 | 我要投稿 ]
通过学习ASP明明白白你的If语句流程。

If condition Then
    [statements1]
Else
    [statements2]
End If

字串7

上边是VBScript脚本If语句的语法,当condition值为True时执行statements1,当condition值为False时执行statements2,由于VBScript的类型自动转换功能,当condition的值为非0的数值时和True等效,当condition的值为0时和False等效。 yueluo.net

实际运用中,我们必须对condition的值有充分的认识,才能对If语句的流程胸有成足。下边我们再举一些例子来加深记忆: 字串7

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

月落网


Tags:ASP,If语句
责任编辑:
您的评论
用户名:新注册) 密码: 匿名评论 [所有评论]

·用户发表意见仅代表其个人意见,并且承担一切因发表内容引起的纠纷和责任
·本站管理人员有权在不通知用户的情况下删除不符合规定的评论信息或留做证据
·请客观的评价您所看到的资讯,提倡就事论事,杜绝漫骂和人身攻击等不文明行为