AND Operator

Logically combines two expressions.

αƒ‘αƒ˜αƒœαƒ’αƒαƒ₯αƒ‘αƒ˜

Result = Expression1 And Expression2

Parameters:

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

Expression1, Expression2: αƒœαƒ”αƒ‘αƒ˜αƒ‘αƒ›αƒ˜αƒ”αƒ αƒ˜ αƒͺαƒ˜αƒ€αƒ αƒ£αƒšαƒ˜ αƒ‘αƒ˜αƒ“αƒ˜αƒ“αƒ”αƒ”αƒ‘αƒ˜ αƒαƒœ αƒ‘αƒ’αƒ αƒ˜αƒ₯αƒαƒœαƒ”αƒ‘αƒ˜, αƒ αƒαƒ›αƒšαƒ”αƒ‘αƒ˜αƒͺ αƒ’αƒ˜αƒœαƒ“αƒαƒ— შეადაროთ.

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.

αƒ›αƒαƒ’αƒαƒšαƒ˜αƒ—αƒ˜:

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 ' returns -1

    vVarOut = B > A And B > C ' returns 0

    vVarOut = A > B And B > D ' returns 0

    vVarOut = (B > D And B > A) ' returns 0

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

End Sub