shadowline
Comparison Operators << Logical Operators >> Data Lists
Logical Operators are on similar ground to comparison operators. They take two items, compare them and perform based on the result. These are the OR, AND and NOT of comparisons.

||
&&
!
OR
AND
NOT



OR will compare two expressions and produce a true result if either expression has a true value (non-zero). The result will have the value of the first true expression value.

If both expression values are zero, the result will hold a zero value.

An example in action.



AND will compare two expressions and produce a true result if both expression values have a true value (non-zero). The result will have the value of the last true expression value.

If one or both expression values are false (zero), then the result will hold a zero value.

An example in action.



NOT will evaluate one expression. If the expression is zero, the result will be true and hold a value of 1. If the expression is non-zero, the result will be false and hold a value of null. null is not zero. It is an empty space.

This is kindof a backwards way of finding a result conidering it is looking for the "non" values. It does come in handy though when that is the desired result you are looking for though.

An example in action.
Comparison Operators << Logical Operators >> Data Lists
shadow

Advertise in the banner along the top, Click here!

Valid XHTML 1.0 Transitional Valid CSS! Text Link Ads
shadow
shadow