Lecture-23(operations order-DeMorgan’s Theorem-arrays)

Lecture-23(operations order-DeMorgan’s Theorem-arrays)

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

View Full Document Right Arrow Icon
Compound Logical Expressions Data Arrays
Background image of page 1

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

View Full Document Right Arrow Icon
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
Background image of page 2
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
Background image of page 3

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

View Full Document Right Arrow Icon
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
Background image of page 4
Image of page 5
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 Right Arrow Icon
Ask a homework question - tutors are online