Operator <> (Not Equal)
Compares two expressions for inequality
Declare Operator <> ( ByRef lhs As Byte, ByRef rhs As Byte ) As Integer
Declare Operator <> ( ByRef lhs As UByte, ByRef rhs As UByte ) As Integer
Declare Operator <> ( ByRef lhs As Short, ByRef rhs As Short ) As Integer
Declare Operator <> ( ByRef lhs As UShort, ByRef rhs As UShort ) As Integer
Declare Operator <> ( ByRef lhs As Integer, ByRef rhs As Integer ) As Integer
Declare Operator <> ( ByRef lhs As UInteger, ByRef rhs As UInteger ) As Integer
Declare Operator <> ( ByRef lhs As LongInt, ByRef rhs As LongInt ) As Integer
Declare Operator <> ( ByRef lhs As ULongInt, ByRef rhs As ULongInt ) As Integer
Declare Operator <> ( ByRef lhs As Single, ByRef rhs As Single ) As Integer
Declare Operator <> ( ByRef lhs As Double, ByRef rhs As Double ) As Integer
Declare Operator <> ( ByRef lhs As String, ByRef rhs As String ) As Integer
Declare Operator <> ( ByRef lhs As ZString, ByRef rhs As ZString ) As Integer
Declare Operator <> ( ByRef lhs As WString, ByRef rhs As WString ) As Integer
Declare Operator <> ( ByRef lhs As T, ByRef rhs As T ) As Integer
Declare Operator <> ( ByRef lhs As Boolean, ByRef rhs As Boolean ) As Boolean
result = lhs <> rhs
lhs
Returns negative one (-1) if expressions are not equal, or zero (0) if equal.
Operator <> (Not equal) is a binary operator that compares two expressions for inequality and returns the result - a boolean value mainly in the form of an Integer: negative one (-1) for true and zero (0) for false. Only if the left and right-hand side types are both Boolean, the return type is also Boolean. The arguments are not modified in any way.
This operator can be overloaded to accept user-defined types as well.
Operator = (Equal) is complement to Operator <> (Not equal), and is functionally identical when combined with Operator Not (Bit-wise Complement).
Syntax
Declare Operator <> ( ByRef lhs As Byte, ByRef rhs As Byte ) As Integer
Declare Operator <> ( ByRef lhs As UByte, ByRef rhs As UByte ) As Integer
Declare Operator <> ( ByRef lhs As Short, ByRef rhs As Short ) As Integer
Declare Operator <> ( ByRef lhs As UShort, ByRef rhs As UShort ) As Integer
Declare Operator <> ( ByRef lhs As Integer, ByRef rhs As Integer ) As Integer
Declare Operator <> ( ByRef lhs As UInteger, ByRef rhs As UInteger ) As Integer
Declare Operator <> ( ByRef lhs As LongInt, ByRef rhs As LongInt ) As Integer
Declare Operator <> ( ByRef lhs As ULongInt, ByRef rhs As ULongInt ) As Integer
Declare Operator <> ( ByRef lhs As Single, ByRef rhs As Single ) As Integer
Declare Operator <> ( ByRef lhs As Double, ByRef rhs As Double ) As Integer
Declare Operator <> ( ByRef lhs As String, ByRef rhs As String ) As Integer
Declare Operator <> ( ByRef lhs As ZString, ByRef rhs As ZString ) As Integer
Declare Operator <> ( ByRef lhs As WString, ByRef rhs As WString ) As Integer
Declare Operator <> ( ByRef lhs As T, ByRef rhs As T ) As Integer
Declare Operator <> ( ByRef lhs As Boolean, ByRef rhs As Boolean ) As Boolean
Usage
result = lhs <> rhs
Parameters
lhs
The left-hand side expression to compare to.
rhsThe right-hand side expression to compare to.
TAny pointer type.
Return Value
Returns negative one (-1) if expressions are not equal, or zero (0) if equal.
Description
Operator <> (Not equal) is a binary operator that compares two expressions for inequality and returns the result - a boolean value mainly in the form of an Integer: negative one (-1) for true and zero (0) for false. Only if the left and right-hand side types are both Boolean, the return type is also Boolean. The arguments are not modified in any way.
This operator can be overloaded to accept user-defined types as well.
Example
Dim As String a = "hello", b = "world"
Dim As Integer i = 10, j = i
If (a <> b) Then
Print a & " does not equal " & b
End If
If (i <> j) Then
Print "error: " & i & " does not equal " & j
End If
Dim As Integer i = 10, j = i
If (a <> b) Then
Print a & " does not equal " & b
End If
If (i <> j) Then
Print "error: " & i & " does not equal " & j
End If
Operator = (Equal) is complement to Operator <> (Not equal), and is functionally identical when combined with Operator Not (Bit-wise Complement).
If (69 <> 420) Then Print "(69 <> 420) is true."
If Not (69 = 420) Then Print "not (69 = 420) is true."
If Not (69 = 420) Then Print "not (69 = 420) is true."
Dialect Differences
- In the -lang qb dialect, this operator cannot be overloaded.
Differences from QB
- none
See also
- Operator = (Equal)