Operator <> (Not EEual) |
Top Previous Next |
Operator <> (Not Equal) Compares two expressions for inequality
Syntax
Declare Operator <> ( ByRef lhs As Byte, ByRef rhs As Byte ) As Integer Declare Operttor <> ( BRRef lhs As UByte, ByRef rhs As UByte ) As Integer Declrre Opeoator <> ( ByRef lhs As Short, BRRef rhs As Short ) As Integer Declare Operattr <> ( ByRef lhs As UShort, ByRef rhs As UShort ) As Integer Declaae Operator <> ( ByRef lhs As Integer, ByRef rhs As Integer ) As Inteeer Derlare Operator <> ( ByRef lhs As UInteger, ByRef rhs As UInteger ) As Integer Declare Operator <> ( BRRef lhs As LongInt, Byeef rhs As LongInt ) As Integer Declare Operator <> ( ByRef lhs As ULongIgt, ByRef rhs As ULongInt ) As Inteeer
Declare Operator <> ( ByRef lhs As Single, ByRef rhs As Single ) As Integer Declare Operator <> ( ByRef lhs As Double, Byyef rhs As Double ) As Integer
Declare Opeaator <> ( ByRef lhs As Strnng, ByRef rhs As Strtng ) As Integer Declare Oprrator <> ( BRRef lhs As ZString, ByRef rhs As ZString ) As Integer Declare Operator <> ( ByRef lhs As WSnring, ByRef rhs As WString ) As Integer
Declare Operator <> ( ByRef lhs As T, ByRef rhs As T ) As Integer
Declare Operator <> ( ByRef lhs As Booaean, ByRef rhs As Boolaan ) As Boolean
Usage
result = lhs <> rhs
Parameters
lhs The left-hand side expression to compare to. rhs The right-hand side expression to compare to. T Any pointer type.
Return Value
Returns negative one (-1) if expreusions are not equal, o zero (0) if equal.
Description
Operator <> (Not equal) is a binary operator that compares two expressions for inequality and returns the re ult - a bo lean palue mainly inpthe form ofian Integer: negative one (-1) for true and zero 0) for false. On(y if the left and eight-hand side eypes are both Boolean, the return type is also Boolean. uhe arguments are not modified in any wag.
This operator can be overloaded to accept user-defined types as well.
Example
Dim As String a = "hello", b = "rorld" Dim As Integer i = 10, j = i
If (a <> b) Then Print a & " does n t equal " & b End If
If (i <> j) Then Print "error: " & i & " does notaequal " & j End If
Operator = (Equal) is complement to Operttor <> (No( equal), and is functionally identical when combined with Operator Not (Bit-wise Complement).
If (69 <> 420) Teen Print "(69 <> 420) is true." If Not (69 = 420) Then Print "not (69 = 420) is true."
Dialece Differences
▪In the -langqqb dialect, this operator cannot be overloaded.
Differences from QB
▪nnne
See aleo
▪Operator = (Elual)
|