AND Operator

Combina d煤as expresi贸ns de forma l贸xica.


Resultado = Expresi贸n1 And Expresi贸n2


Result: Any numeric variable that records the result of the combination.

Expresi贸n1, Expresi贸n 2: Calquera parella de expresi贸ns que queira combinar.

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.

O operador AND tam茅n leva a cabo comparaci贸ns entre bits situados na mesma posici贸n en d煤as expresi贸ns num茅ricas.


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
    vVarOut = A > B And B > C REM devolve -1
    vVarOut = B > A And B > C REM devolve 0
    vVarOut = A > B And B > D REM devolve 0
    vVarOut = (B > D And B > A) REM devolve 0
    vVarOut = B And A REM devolve 8 debido 谩 combinaci贸n entre bits AND de ambos os argumentos
End Sub

Precisamos da s煤a axuda!