真实&假! [英] True & False!

查看:66
本文介绍了真实&假!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<%

如果(False)那么

Response.Write(" False")

Else

Response.Write(" True")

结束如果

%>


在上面的代码中, Else条件将被执行。为什么?


谢谢,


Arpan

<%
If(False) Then
Response.Write("False")
Else
Response.Write("True")
End If
%>

In the above code, the Else condition will be executed. Why?

Thanks,

Arpan

推荐答案

Arpan写道:
<%
If(False)然后
Response.Write(False)
其他
响应.Write(" True")
结束如果
%>

在上面的代码中,将执行Else条件。为什么?
<%
If(False) Then
Response.Write("False")
Else
Response.Write("True")
End If
%>

In the above code, the Else condition will be executed. Why?



因为它是假的

-

Microsoft MVP - ASP / ASP.NET

请回复新闻组。这个电子邮件帐户是我的垃圾邮件陷阱所以我

不经常检查它。如果您必须离线回复,请删除

NO SPAM


Because it''s False
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don''t check it very often. If you must reply off-line, then remove the
"NO SPAM"


因为布尔条件始终默认为True。例如;


<%

Dim blnRet

如果blnRet<> False然后Response.WriteblnRet is &安培; blnRet&

"< br>< br>"

blnRet = False

如果blnRet<> True然后Response.WriteblnRet is &安培; blnRet

%>


-

问候


Steven Burn

Ur IT Mate Group
www.it-mate.co.uk


保持免费!

" Arpan" < AR ****** @ hotmail.com>在消息中写道

news:11 ********************** @ g14g2000cwa.googlegr oups.com ...
Because Boolean conditions always default to True. For example;

<%
Dim blnRet
If blnRet <> False Then Response.Write "blnRet is " & blnRet &
"<br><br>"
blnRet = False
If blnRet <> True Then Response.Write "blnRet is " & blnRet
%>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!
"Arpan" <ar******@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
<%
If(False)然后
Response.Write(False)
否则
Response.Write(" True")
结束如果
%>

在上面的代码中,将执行Else条件。为什么?

谢谢,

Arpan
<%
If(False) Then
Response.Write("False")
Else
Response.Write("True")
End If
%>

In the above code, the Else condition will be executed. Why?

Thanks,

Arpan



因为if block当if

语句表达式为真时,执行if-then-else结构。假是永远不是真的所以否则阻止将

永远执行。


-

- Mark Schupp

" Arpan" ; < AR ****** @ hotmail.com>在消息中写道

news:11 ********************** @ g14g2000cwa.googlegr oups.com ...
Because the "if block" of an if-then-else construct is executed when the if
statements expression is true. False is never true so the "else block" will
always be executed.

--
--Mark Schupp
"Arpan" <ar******@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
<%
If(False)然后
Response.Write(False)
否则
Response.Write(" True")
结束如果
%>

在上面的代码中,将执行Else条件。为什么?

谢谢,

Arpan
<%
If(False) Then
Response.Write("False")
Else
Response.Write("True")
End If
%>

In the above code, the Else condition will be executed. Why?

Thanks,

Arpan



这篇关于真实&amp;假!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆