哪个是更好的结构? [英] Which is the better construct?

查看:77
本文介绍了哪个是更好的结构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很想知道下面哪个IF语句更好。 strQCType
可以是LCS,MS,REG,LD或LB。我希望

IF语句中的代码仅在LCS事件中执行。或者MS。


If((strQCType =" LCS")或(strQCType =" MS"))然后


结束如果

-OR-

If(strQCType =" LCS")或(strQCType =" MS")那么


结束如果


谢谢,

Vint

解决方案


v.*****@comcast.net 写道:


我很想知道下面哪个IF语句更好。 strQCType
可以是LCS,MS,REG,LD或LB。我希望

IF语句中的代码仅在LCS事件中执行。或者MS。


If((strQCType =" LCS")或(strQCType =" MS"))然后


结束如果


-OR-


If(strQCType =" LCS")Or(strQCType =" MS")Then


结束如果


谢谢,

Vint



就个人而言,没有区别。


-

Tom Shelton


< blockquote>我很想知道下面哪个IF语句更好。 strQCType


可以是LCS,MS,REG,LD或LB。我希望

IF语句中的代码仅在LCS事件中执行。或MS。



如果我没有遗漏某些东西,它们是一样的。那个括号不是
有所作为。更快的版本将是:


If(strQCType =" LCS")OrElse(strQCType =" MS")然后


结束If


-

Pozdrav,

Josip Medved
http://www.jmedved.com


" Josip Medved" ; < jm ***** @jmedved.comschrieb:


>我很想知道下面哪个IF语句更好。 strQCType
可以是LCS,MS,REG,LD或LB。我希望
IF语句中的代码仅在LCS的情况下执行。或MS。



如果我没有遗漏某些东西,它们是一样的。那个括号不是
有所作为。更快的版本将是:


If(strQCType =" LCS")OrElse(strQCType =" MS")然后


结束If



ACK,这也是我用过的。来自VB6的大多数开发人员仍然使用

''或''即使''OrElse''更有意义......


-

MS Herfried K. Wagner

MVP< URL:http://dotnet.mvps.org/>

VB< URL:http: //dotnet.mvps.org/dotnet/faqs/>


I am curious to know which IF statement below is better. strQCType
could be "LCS", "MS", "REG", "LD", or "LB". I want the code within the
IF statements to execute only in the event of an "LCS" or "MS".

If ((strQCType = "LCS") Or (strQCType = "MS")) Then

End If
-OR-
If (strQCType = "LCS") Or (strQCType = "MS") Then

End If

Thanks,
Vint

解决方案


v.*****@comcast.net wrote:

I am curious to know which IF statement below is better. strQCType
could be "LCS", "MS", "REG", "LD", or "LB". I want the code within the
IF statements to execute only in the event of an "LCS" or "MS".

If ((strQCType = "LCS") Or (strQCType = "MS")) Then

End If
-OR-
If (strQCType = "LCS") Or (strQCType = "MS") Then

End If

Thanks,
Vint

Personally, it makes no difference.

--
Tom Shelton


I am curious to know which IF statement below is better. strQCType

could be "LCS", "MS", "REG", "LD", or "LB". I want the code within the
IF statements to execute only in the event of an "LCS" or "MS".

If I am not missing something, they are the same. That brackets don''t
make the difference. Quicker version would be:

If (strQCType = "LCS") OrElse (strQCType = "MS") Then

End If

--
Pozdrav,
Josip Medved
http://www.jmedved.com


"Josip Medved" <jm*****@jmedved.comschrieb:

>I am curious to know which IF statement below is better. strQCType
could be "LCS", "MS", "REG", "LD", or "LB". I want the code within the
IF statements to execute only in the event of an "LCS" or "MS".


If I am not missing something, they are the same. That brackets don''t
make the difference. Quicker version would be:

If (strQCType = "LCS") OrElse (strQCType = "MS") Then

End If

ACK, that''s what I''d use too. Most developers coming from VB6 still use
''Or'' even if ''OrElse'' makes more sense...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>


这篇关于哪个是更好的结构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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