Module
Contents
Index 🔎︎

# AND Operator

Menggabungkan dua ekspresi secara logikal.

## Sintaksis:

    Hasil = Ekspresi1 And Ekspresi2

## Parameter:

Hasil: Variabel numerik apa saja yang mengandung hasil dari kombinasi.

Ekspresi1, Ekspresi2: Ekspresi apa saja yang hendak Anda gabungkan.

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

True AND True menghasilkan True; untuk hasil kombinasi yang lain akan menghasilkan False.

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

## Contoh:

    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 menghasilkan -1

        vVarOut = B > A And B > C REM menghasilkan 0

        vVarOut = A > B And B > D REM menghasilkan 0

        vVarOut = (B > D And B > A) REM menghasilkan 0

        vVarOut = B And A ' returns 8 due to the bitwise And combination of both arguments

    End Sub