ISBLANK()

Syntax

Result_Flag as L = ISBLANK( Field_Name as C )

Argument

Description

Field_Name

The name of a table field used in a form or browse.

Description

ISBLANK() returns .T. (TRUE) if the field identified in the Field_Name is blank; otherwise, it returns .F. (FALSE). This function works on any type of field. The function can be used is event coding for forms and browses.

Note : To test for a blank string, use ISNULL().

Supported By

Alpha Five Version 5 and Above

Examples

If CUST_ID contains "C001".

? isblank("CUST_ID")

= .F.

If ADDRESS2 is empty.

? isblank("ADDRESS2")

= .T.

isblank(FIELD_NAME) -> TRUE, if the FIELD_NAME variable contains "ADDRESS2" and the ADDRESS2 field is empty.

If the FIELD_NAME variable contains "ADDRESS2" and the ADDRESS2 field is empty.

? isblank(FIELD_NAME)

= .T.

Assume that you want to remove incomplete records from your table. A quick way to identify these records is to choose a field that is normally be filled in (e.g., the LASTNAME field), and search for all occurrences where it is blank. The following filter expression would work:

isblank("LASTNAME")

Use this filter with the Mark records operation to delete the active records, followed by Pack to remove them from the table.

Another way to use this function is in a mailing list application. Assume that you want your label to print "Resident" on the first line if the LASTNAME field is blank. Create and place a calculated field that uses the expression:

if(isblank("LASTNAME"), "RESIDENT", trim(FIRSTNAME) + " " + LASTNAME)

See Also

Type Checking Functions