Function Empty() Foundation
Tests whether an expression returns an empty value.
Empty( <Expression> ) --> lEmpty
The return value of Empty() is .T. (true) when the value of <Expression> is empty, otherwise it is .F. (false). An empty value depends on the data type of the value. The following table lists the empty values for each data type:
Valtype() | Data type | Value |
---|---|---|
A | array | {} (array with length 0) |
B | code block | no empty value |
C | character | blank spaces, tabs, CRLF or null strings ("") |
D | date | CtoD("") or CtoD(" / / ") (empty date) |
L | logical | .F. (False) |
N | numeric | 0 |
O | object | no empty value |
U | undefined | NIL |
The logical function Empty() is frequently used for validation of data input. For example, it can be used to test whether a user has entered data in an input field. The function is also used for parameter testing within functions and procedures when a value for a passed parameter is required.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.