ISBLANK() Function Provides Additional Null Value Support

ID: Q114654

The information in this article applies to:

SUMMARY

This article describes the new ISBLANK() function, which, along with the new BLANK command, provides additional support of null values.

This information can also be found in FoxPro online Help in the "ISBLANK()" topic.

MORE INFORMATION

ISBLANK(<expr>)

Determines whether or not an expression is blank. Returns - Logical

ISBLANK() returns true (.T.) if the expression <expr> is blank, or false (.F.) if the expression is not blank.

APPEND BLANK and BLANK are used to create a blank record. BLANK can also be used to clear data from fields in a record. ISBLANK() can determine whether or not a field is blank.

The ISBLANK() function is different from the EMPTY() function. For example, EMPTY() returns true if a character expression contains any combination of nulls, spaces, tabs, carriage returns, or line feeds. ISBLANK() returns true only if a character expression contains a null string or spaces.

<expr>

<expr> can be a field in a table/.DBF file, a memory variable or array element, or an expression.

For a field, ISBLANK() returns .T. if the field contains the following values:

   Type            Contents
   ---------------------------------------------------------------------

   Character       Null string or spaces
   Numeric         No value (Newly appended blank record or cleared with
                   BLANK)
   Date            Blank date ({  /  /  })
   Logical         No value (Newly appended blank record or cleared with
                   BLANK)
   Memo            Empty (no memo contents)
   General         Empty (no OLE object)

For a character or date type memory variable, array element or expression, ISBLANK() returns .T. if any of these contain the following values:

   Type            Contents
   ---------------------------------------

   Character       Null string or spaces
   Date            Blank date ({  /  /  })

Additional reference words: FoxDos FoxWin 2.60 foxhelp.dbf foxhelp.hlp KBCategory: kbprg KBSubcategory: FxinteropOle

Last Reviewed: June 26, 1995