Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
When is .NULL.= .NULL.?
Message
De
28/07/2000 14:41:27
 
 
À
28/07/2000 14:31:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00398289
Message ID:
00398293
Vues:
27
There is a difference between a string that contains a space (" ") and an empty string (""). There is also a difference in the way VFP evaluates these strings depending on what your SET EXACT setting is:

SET EXACT OFF
?" " = "" && Evaluates to True
?"" = " " && Evaluates to False
SET EXACT ON
?" " = "" && Evaluates to True
?"" = " " && Evaluates to True

To check a value to see if it is NULL use the ISNULL function:
?ISNULL(BARCODE) &&Returns True if BARCODE is NULL

>Hi all:
>I have a program that searches for a [CODENUMBER] and then checks the value of the [BARCODE] field. I want some action taken if the field is .NULL. I know the field is .NULL. because that is how it shows in the field and i can see that value in a debug window. However, the line
>If BARCODE = .NULL.
>doesn't evaluate as true. Why?
>
>Also, this two empty strings:
>" " and "" aren't the same? Why?
>
>Thank you in advance.
>
>Ulises
Thanks,
Dan Jurden
djurden@outlook.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform