Lecture-23(operations order-DeMorgan&acirc;€™s Theorem-arrays)

Lecture-23(operations order-DeMorganâ€™s Theorem-arrays)

This preview shows pages 1–5. Sign up to view the full content.

Compound Logical Expressions Data Arrays

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Priority of Logical Operators The relational operators: =, <>, <, >, <=, >= all have the same priority in VBA The logical operators have a distinct hierarchy Not And Or The relational operators take precedence over the logical operators. The arithmetic operations take precedence over relational operations Decreasing priority
An Example The objective is to evaluate if the following statement gives rise to a TRUE or FALSE declaration, corresponding to a = -1, b = 2, x = 1 and y = “b” First the arithmetic operations are evaluated Next the Relational operations are evaluated a * b > 0 And b = 2 And x > 7 Or Not y > “d” -2 > 0 And 2 = 2 And 1 > 7 Or Not “b” > “d” F And T And F Or Not F

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Example (Cont’d) Next the Logical Operators are evaluated First the NOT: NOT F T Next the AND operators are evaluated F AND T F F AND F F F And T And F Or Not F F And T And F Or T F And F Or T F Or T T So the end evaluation is TRUE
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 10

Lecture-23(operations order-DeMorganâ€™s Theorem-arrays)

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online