AND Operator

Loģiski apvieno divas izteiksmes.

Sintakse:


Rezultats = Izteiksme1 And Izteiksme2

Parametri:

Rezultats: jebkura skaitliskā izteiksme, kura ieraksta reizināšanas rezultātu.

Izteiksme1, Izteiksme2: jebkuras izteiksmes, kuras jūs vēlaties apvienot.

Boolean expressions combined with AND only return the value True if both expressions evaluate to True:

True AND True returns True; for all other combinations the result is False.

The AND operator also performs a bitwise comparison of identically positioned bits in two numeric expressions.

Piemērs:


Sub ExampleAnd
Dim A As Variant, B As Variant, C As Variant, D As Variant
Dim vVarOut As Variant
    A = 10: B = 8: C = 6: D = Null
    mIzv = A > B Eqv B > C ' atgriež -1
    mIzv = B > A Eqv B > C ' atgriež 0
    mIzv = A > B Eqv B > D ' atgriež 0
    mIzv = (B > D Eqv B > A) ' atgriež -1
    vVarOut = B And A ' returns 8 due to the bitwise And combination of both arguments
End Sub

Please support us!