如果声明不符合条件 [英] If statement not catching on conditions

查看:76
本文介绍了如果声明不符合条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有下面的if语句,如果满足任何

条件就应该捕获.......但是由于某些原因,如果我的

boolDSIFlushGapReading = true和MuxClass.DSIValues.count = 1和我的

muxclass.COM1Active = 1它不会退出程序???为什么这样可以

任何人帮助我


紧急!!!!!!


如果boolDSIFlushGapReading = False并且muxClass.DSIValues.Count< 2和

不是muxClass.COM1Active = 1然后

退出Sub

结束如果

I have the below if statement, that should catch if any of the
conditions are met.....however for some reasons if my
boolDSIFlushGapReading = true and MuxClass.DSIValues.count =1 and my
muxclass.COM1Active =1 it will not exit the program??? Why is that can
anyone help me

Urgent!!!!!!

If boolDSIFlushGapReading = False And muxClass.DSIValues.Count < 2 And
Not muxClass.COM1Active = 1 Then
Exit Sub
End If

推荐答案



" cmdolcet69" < co ************ @ hotmail.comwrote in message

新闻:0f ****************** **************** @ m32g2000 hsf.googlegroups.com ...

"cmdolcet69" <co************@hotmail.comwrote in message
news:0f**********************************@m32g2000 hsf.googlegroups.com...

>我有以下if语句,如果满足任何

条件,那应该会被捕获......但是由于某些原因,如果我的

boolDSIFlushGapReading = true和MuxClass.DSIValues.count = 1并且我的

muxclass.COM1Active = 1它不会退出程序???为什么这样可以

任何人帮助我


紧急!!!!!!


如果boolDSIFlushGapReading = False并且muxClass.DSIValues.Count< 2和

不是muxClass.COM1Active = 1然后

退出Sub

结束如果
>I have the below if statement, that should catch if any of the
conditions are met.....however for some reasons if my
boolDSIFlushGapReading = true and MuxClass.DSIValues.count =1 and my
muxclass.COM1Active =1 it will not exit the program??? Why is that can
anyone help me

Urgent!!!!!!

If boolDSIFlushGapReading = False And muxClass.DSIValues.Count < 2 And
Not muxClass.COM1Active = 1 Then
Exit Sub
End If



任何=或

全部=和


您的声明希望在退出之前满足所有条件

发生。


LS

Any = Or
All = And

your statement wants all the conditions to be met before the exit will
occur.

LS


你想要一个OR连接器而不是AND吗?

你说:如果满足任何条件就应该抓住




如果(不是boolDSIFushGapReading)或者(muxClass.DSIValues.Count< 2) )或者

(muxClass.COM1Active< 1)然后


这样做吗?


" cmdolcet69"写道:
Did you want an OR connector instead of AND?
You said: should catch if ANY of the conditions are met

Would
If (not boolDSIFlushGapReading) OR (muxClass.DSIValues.Count < 2) OR
(muxClass.COM1Active <1) Then

do it?

"cmdolcet69" wrote:

我有以下if语句,如果满足任何

条件,应该捕获.....一些原因,如果我的

boolDSIFlushGapReading = true和MuxClass.DSIValues.count = 1和我的

muxclass.COM1Active = 1它不会退出程序???为什么这样可以

任何人帮助我


紧急!!!!!!


如果boolDSIFlushGapReading = False并且muxClass.DSIValues.Count< 2和

不是muxClass.COM1Active = 1然后

退出Sub

结束如果
I have the below if statement, that should catch if any of the
conditions are met.....however for some reasons if my
boolDSIFlushGapReading = true and MuxClass.DSIValues.count =1 and my
muxclass.COM1Active =1 it will not exit the program??? Why is that can
anyone help me

Urgent!!!!!!

If boolDSIFlushGapReading = False And muxClass.DSIValues.Count < 2 And
Not muxClass.COM1Active = 1 Then
Exit Sub
End If

< br>

2008年10月29日星期三10:20:57 -0700(PDT),cmdolcet69

< co ************ @ hotmail。编写:
On Wed, 29 Oct 2008 10:20:57 -0700 (PDT), cmdolcet69
<co************@hotmail.comwrote:

>我有以下if语句,如果符合任何条件,应该捕获.......但是由于某些原因若我的
boolDSIFlushGapReading = true且MuxClass.DSIValues.count = 1且我的
muxclass.COM1Active = 1则不会退出程序???为什么会有人帮助我

紧急!!!!!!
如果boolDSIFlushGapReading = False和muxClass.DSIValues.Count< 2并且
不是muxClass.COM1Active = 1然后

退出Sub

结束如果
>I have the below if statement, that should catch if any of the
conditions are met.....however for some reasons if my
boolDSIFlushGapReading = true and MuxClass.DSIValues.count =1 and my
muxclass.COM1Active =1 it will not exit the program??? Why is that can
anyone help me

Urgent!!!!!!

If boolDSIFlushGapReading = False And muxClass.DSIValues.Count < 2 And
Not muxClass.COM1Active = 1 Then
Exit Sub
End If



你的声明说只有在满足所有三个满
条件时才执行Exit Sub。在你的例子中,第一个没有被满足,

其他两个是。


显然你想要或而不是和。如果

项为真,则测试为真,并且测试为真,两个项都为真。


此外,你应该使用AndAlso和OrElse而不是And和Or为

这样的测试。

Your statement says to execut the Exit Sub only if all three
conditions are met. In your example the first one is not met and the
other two are.

Apparently you want Or instead of And. An Or test is true if either
item is true, and And test is true of both items are true.

Also, you should use AndAlso and OrElse instead of And and Or for
tests like this.


这篇关于如果声明不符合条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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