vba VBA中<>是什么运算符

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12997645/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 14:15:35  来源:igfitidea点击:

What operator is <> in VBA

vbaoperators

提问by vini

I was studying some vbacode and came across this:

我正在研究一些vba代码并遇到了这个:

If DblBalance <> 0 Then

I can't figure out what operator this is, any help would be appreciated.

我无法弄清楚这是什么运营商,任何帮助将不胜感激。

回答by ThiefMaster

It is the "not equal" operator, i.e. the equivalent of !=in pretty much every other language.

它是“不等于”运算符,即!=几乎所有其他语言中的等价物。

回答by DigitalRoss

Not Equal To

不等于



Before C came along and popularized !=, languages tended to use <>for not equal to.

在 C 出现并普及之前!=,语言倾向于使用<>for not equal to

At least, the various dialects of Basic did, and they predate C.

至少,Basic 的各种方言确实如此,而且它们早于 C。

An even older and more unusual case is Fortran, which uses .NE., as in X .NE. Y.

一个更古老和更不寻常的例子是 Fortran,它使用.NE., 如X .NE. Y

回答by Xathereal

It means not equal to, as the others said..

正如其他人所说,这意味着不等于..

I just wanted to say that I read that as "greater than or lesser than".

我只是想说我把它读为“大于或小于”。

e.g.

例如

let x = 12

if x <> 0 then
    //code

In this case 'x' is greater than (that's the '>' symbol) 0.

在这种情况下,“x”大于(即“>”符号)0。

Hope this helps. :D

希望这可以帮助。:D

回答by Abubakkar

It is an "INEQUALITY" operator. Get a list of comparison operators in VBA

它是一个“INEQUALITY”运算符。获取 VBA 中的比较运算符列表

回答by rahul

in sql... we use it for "not equals"... I am guessing, its the same in VB aswell.

在 sql 中......我们将它用于“不等于”......我猜,它在 VB 中也是一样的。

回答by shishir

In VBA this is <> (Not equal to)operator.

在 VBA 中,这是<> (Not equal to)运算符。

The result becomes true if expression1 <> expression2

结果为真,如果 expression1 <> expression2

The result becomes false if expression1 = expression2

如果结果为假 expression1 = expression2

Additional Reading 1

附加阅读 1

Additional Reading 2

补充阅读 2

回答by Kurt H

This is an Inequality operator.

这是一个不等式运算符。

Also,this might be helpful for future: Operators listed by Functionality

此外,这可能对未来有帮助:按功能列出的运算符