Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logical field: false (.f.) vs Null

Status
Not open for further replies.

fox26apgmr

Programmer
Apr 30, 2002
21
0
0
US
Hi,
Is there a way to test if a logical field actually contains the false setting versus defaulting to false because it is null?
Thanks, Joe
 
FoxPro for DOS and Windows don't support "null", although VFP does. Logicals can only be .T. or .F. if it's not true, it's false!

Rick
 
Joe,
Try using the ISBLANK(fieldname) function to validate whether that particular field actually contains the false setting versus defaulting to false because it is null.
I also had the same problem and i received help from this forum on this count.



Best Regards,
Yours sincerely,
Udai.
 
Just for the record, you might notice here that there are 3 states a field can have (in VFP), two of those states used to exist in FPDos:

Blank - Hasn't been filled in yet (use ISBLANK() to check)
Null - Is marked as having No data (use ISNULL() to check)
Something - May be spaces, or whatever values are valid for the field's data type. You can see if it's spaces/tabs using EMPTY()

So:
ISNULL( .NULL. ) = .T.
ISBLANK( .NULL. ) = .F.
EMPTY( .NULL. ) = .F.

Tbl.Fld is a "blank" field:
ISNULL( tbl.Fld ) = .F.
ISBLANK( tbl.Fld ) = .T.
EMPTY( tbl.Fld ) = .T.

Tbl.Fld = 0 or spaces:
ISNULL( tbl.Fld ) = .F.
ISBLANK( tbl.Fld ) = .F.
EMPTY( tbl.Fld ) = .T.

Tbl.Fld <>0 or has some characters:
ISNULL( tbl.Fld ) = .F.
ISBLANK( tbl.Fld ) = .F.
EMPTY( tbl.Fld ) = .F.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top