共用方式為


ISNULL( ) Function

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

ISNULL(eExpression)

Return Values

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

NVL( ) | SET NULL | Handling Null Values