Compartir a través de


ISNULL( ) Function

Returns true (.T.) if an expression evaluates to a null value; otherwise, ISNULL( ) returns false (.F.).

ISNULL(eExpression)

Return Value

Logical

Parameters

  • eExpression
    Specifies the expression to evaluate.

Remarks

Use ISNULL( ) to determine if the contents of a field, memory variable, or array element contains a null value, or if an expression evaluates to a null value.

Example

In the following example, ISNULL( ) is used to check for a null value.

STORE .NULL. TO mNullvalue  && Store a null value to a memory variable

CLEAR
? mNullvalue  && Display the value of the memory variable
? ISNULL(mNullvalue)  && Returns .T., indicating a null value
? TYPE('mNullvalue')     && Returns L, indicating a logical value
? (mNullvalue = .NULL.)  && Returns .NULL., bad test for null values

See Also

Reference

NVL( ) Function

SET NULL Command

Null Value Handling

Other Resources

Functions

Language Reference (Visual FoxPro)