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