JavaScript Editor js editor     Web development 

Main Page

Passing a null value as a parameter affects the behavior of many commands and functions in Visual FoxPro. The following general rules apply to null values passed to commands and functions:

  • Commands generate errors when passed a null value.

  • Functions that accept .NULL. as a valid value propagate .NULL. to the result.

  • Functions that accept parameters that could be numeric values generate an error if you supply .NULL. for those parameters.

    В Copy Code
    USE Mytable ALIAS &n            && Expected a workarea 
                                  && name or number
    ? SUBSTR("Hello, world",n,5)   && Expected a position
                                  && in the string
  • ISBLANK(В ), ISDIGIT(В ), ISLOWER(В ), ISUPPER(В ), ISALPHA(В ), and EMPTY return false (.F.) when passed a null value. ISNULL(В ) returns true (.T.) when passed a null value.

  • The commands INSERTВ -В SQL and SELECTВ -В SQL process null values through the IS NULL and IS NOT NULL clauses and, in the case of INSERT, UPDATE, and REPLACE, place null values into records.

  • SQL Aggregate functions ignore instead of propagate null values.

  • Visual FoxPro aggregate functions only propagate .NULL. if all supplied values are null values; otherwise, any null value is ignored.

For more information on using null values in your application, see Working with Tables.

See Also

JavaScript Editor js editor     Web development