IsBlank()

ISBLANK() indicates whether a passed expression is blank, as distinguished from empty.

Usage

lReturnValue = ISBLANK( eExpression )
This function was added in FoxPro 2.6 for dBASE compatibility. It represents an approach that's sort of halfway to real nulls. Blank is that pristine condition you see for numbers or logicals in a Browse until you actually store some data in that field. Blanks are of limited utility because they can't be distinguished from emptiness for character and date types. With the addition of true nulls in Visual FoxPro, we can't see any reason to use blanks anymore. Even if the possibility of using a four-state logical field is attractive at first, you'll find coding and processing blanks to be far more work than it is worth.The BLANK command lets you reset fields to blank.

Example

CREATE TABLE Test (cfld C(3), dfld D, nfld N(3), lfld L)
* add a record
APPEND BLANK
? ISBLANK(cfld)   && returns .T.
? ISBLANK(dfld)   && returns .T.
? ISBLANK(nfld)   && returns .T.
? ISBLANK(lfld)   && returns .T.
 
* now store empty values in it
REPLACE cfld WITH "", ;
    dfld WITH {}, ;
    nfld WITH 0, ;
    lfld WITH .f.
 
? ISBLANK(cfld)   && returns .T.
? ISBLANK(dfld)   && returns .T.
? ISBLANK(nfld)   && returns .F.
? ISBLANK(lfld)   && returns .F.

See Also

Blank, Empty(), IsNull()


Back to Table of Contents

Copyright © 2002-2018 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. Click for license .