Share via


Logical Expression Creation

Logical expressions have one of two values — true or false. .T. and .F. are used to specify true and false in Visual FoxPro.

Compose logical expressions by combining logical operators with the following Visual FoxPro elements:

  • Logical type fields.
  • Functions that return logical values.
  • Variables and array elements that contain logical values.
  • Any expression that evaluates to a logical value.

Visual FoxPro evaluates logical expressions from left to right, and only for as long as necessary. In the following example, the AND operator is used to create a logical expression. If any of the values in the expression are false (.F.), the entire expression is false. When Visual FoxPro encounters the first logical false (.F.), it doesn't evaluate the rest of the expression.

.T. AND .T. AND .F. AND .T. AND .T. AND .T.

See Also

Logical Operators | _RetLogical( ) API Library Routine | Logical Data Type | Expression Building