Imp Operator

Performs a logical implication on two expressions.

āļšāˇāļģāļš āļģāˇ“āļ­āˇ’āļē:


āļ´āˇŠâ€āļģāļ­āˇ’āļĩāļŊāļē = āļ´āˇŠâ€āļģāļšāˇāˇāļąāļē1 + āļ´āˇŠâ€āļģāļšāˇāˇāļąāļē2

āļ´āļģāˇāļ¸āˇ’āļ­āˇ“āļąāˇŠ:

Result:āˇƒāļ‚āļšāļŊāļąāļēāˇš āļ´āˇŠâ€āļģāļ­āˇ’āļĩāļŊāļē āļ…āļŠāļ‚āļœāˇ” āˇ€āļą āļ•āļąāˇ‘āļ¸ āˇƒāļ‚āļ›āˇŠâ€āļēāˇāļ­āˇŠāļ¸āļš āˇ€āˇ’āļ āļŊāˇŠâ€āļēāļēāļšāˇŠ.

Expression1, Expression2: Any expressions that you want to evaluate with the Imp operator.

If you use the Imp operator in Boolean expressions, False is only returned if the first expression evaluates to True and the second expression to False.

If you use the Imp operator in bit expressions, a bit is deleted from the result if the corresponding bit is set in the first expression and the corresponding bit is deleted in the second expression.

āļ‹āļ¯āˇāˇ„āļģāļĢāļē:


Sub ExampleImp
Dim A As Variant, B As Variant, C As Variant, D As Variant
Dim vOut As Variant
    A = 10: B = 8: C = 6: D = Null
    vOut = vA > vB Xor vB > vD REM returns -1
    vOut = vB > vA Xor vB > vC REM returns -1
    vOut = vA > vB Xor vB > vC REM returns 0
    vOut = (vB > vD Xor vB > vA) REM returns 0
    vOut = vB Xor vA REM returns 2
End Sub

Please support us!