Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
NULL
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: NULL
Divers
Thread ID:
00257266
Message ID:
00257271
Vues:
18
>Jim,
>
>You gave me the following code:
>
>* control's valid
>IF EMPTY( THIS.Value )
> THIS.Value = .NULL.
>ENDIF
>
>This works for character and memo datatypes but I can't get it to work for numerics. When I type in a 0 (zero) and tab out it becomes NULL.
>
>Can you help?

The problem is that 0 is the defined EMPTY() value for a numeric field, and in this case, EMPTY() and ISNULL() do not mean the same things. You'll have the same problem with logicals, where .F. is empty but not null, and with dates, where {} is empty but not null. You might try changing the first line of Jim's code fragment to:

IF VARTYPE(this.Value) = 'C' AND EMPTY(this.Value)

since both memo fields and strings will return "C"
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform