RAD Studio
ContentsIndex
PreviousUpNext
Logical Operators

Syntax

logical-AND-expr  && inclusive-OR-expression
logical-OR-expr   || logical-AND-expression
! cast-expression

Remarks 

Operands in a logical expression must be of scalar type. 

&& logical AND; returns true only if both expressions evaluate to be nonzero, otherwise returns false. If the first expression evaluates to false, the second expression is not evaluated. 

|| logical OR; returns true if either of the expressions evaluate to be nonzero, otherwise returns false. If the first expression evaluates to true, the second expression is not evaluated. 

! logical negation; returns true if the entire expression evaluates to be nonzero, otherwise returns false. The expression !E is equivalent to (0 == E).

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!