Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I check if numeric field is 0 or blank
Message
From
26/08/1999 14:59:17
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
26/08/1999 14:29:48
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00257901
Message ID:
00258097
Views:
18
>ThanK _you!! That worked great.
>Gary


Gary,

You might like to try the following for a better understanding of IsBlank(), IsNull(), and Empty().



*!* Compare IsBlank(), Empty(), and IsNull() with the following test

*!* Note that EMPTY() will return true for a zero or white space numeric
*!* ISBLANK() will successfully distinguish between the zero
*!* and the white space entry
*!* A .NULL. value is neither blank or empty.

CREATE CURSOR Dummy ;
(nDummy N NULL, nValOfDummy N NULL, lISBlank l, lISNull l, lEmpty l)

APPEND BLANK
REPLACE nValOfDummy WITH nDummy, ;
lISBlank WITH IsBlank(nDummy), ;
lISNull WITH ISNULL(nDummy), ;
lEmpty WITH EMPTY(nDummy)

APPEND BLANK
REPLACE nDummy WITH 0, ;
nValOfDummy WITH nDummy, ;
lISBlank WITH IsBlank(nDummy), ;
lISNull WITH ISNULL(nDummy), ;
lEmpty WITH EMPTY(nDummy)

APPEND BLANK
REPLACE nDummy WITH .NULL., ;
nValOfDummy WITH nDummy, ;
lISBlank WITH IsBlank(nDummy), ;
lISNull WITH ISNULL(nDummy), ;
lEmpty WITH EMPTY(nDummy)

BROWSE

*!* To return a numeric field to white space as if it has never been entered:

BLANK FIELDS LIKE nDummy
Previous
Reply
Map
View

Click here to load this message in the networking platform