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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Testing for NULL in Numeric/Date Fields

Status
Not open for further replies.

Goofus828

Programmer
Nov 9, 2005
127
0
0
US
Is there anyway to test for NULL in a date or numeric field with out getting the "Invalid function argument value, type, or count." error message in FoxPro for DOS?

I test for chr(0) in character fields with no problems and I know there is ISNULL() in VFP that works fine but I need this for DOS.

Thanks.

 
And, of course, the function EMPTY().
Ex:
?EMPTY(date()) && .f.
?EMPTY({}) && .t.
?EMPTY(0) && .t.
?EMPTY(5) && .f.
 
I'm acutally working in Dos 2.5b. So Isblank() does not exist in that version.
 
I don't think there is a way to look for a null character in non-character field.
I think you would have to use low level I/O functions such as FOPEN(), FREAD() etc., to test for the existence of CHR(0). From there, you could calc the offset and see if it was in the position of a non-numeric field.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Thanks everyone. I did not think there was a way to find a null. I'll just keep pushing them to VFP!


Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top