Xbasic

NULL_VALUE Function

Syntax

A NULL_VALUE()

Description

Assign a null value to any type.

Discussion

NULL_VALUE() is used in an Update Operation or an Xbasic script to assign NULL to a field or variable.

Example

dim t as P
t = table.open("orders")
t.change_begin()
t.date = NULL_VALUE()
t.change_end(.T.)
t.close()

Note : Numeric variables are a special case. You cannot use NULL_VALUE() with a numeric variable. However, if you have a numeric field, you can set the field value to NULL_VALUE().

dim t as P
t = table.open("journal")
? t.PERIOD_YEAR
= 34
t.change_begin()
t.PERIOD_YEAR = NULL_VALUE()
t.change_end(.t.)
t.close()
? t.PERIOD_YEAR
= 0

If you look at this table in browse mode you will actually see that there is no value visible in the period_year column.

See Also