Xbasic

ISNOTBLANK Function

Syntax

Result_Flag as L = ISNOTBLANK(C fieldname)

Arguments

fieldname

The name of a table field used in a form or browse.

Description

Returns TRUE if the field is not blank.

Discussion

ISNOTBLANK() returns .T. (TRUE) if Field_Name contains a value; otherwise, it returns .F. (FALSE). The function can be used is event coding for forms and browses.

Example

The following code could be attached to a button on a form.

isnotblank("Company") -> .T. if Company contains "Alpha Software"
isnotblank("Company") -> .F. if Company contains ""

The following code could be used in an Xbasic script.

dim tbl as P
tbl = table.open("customer")
tbl.fetch_first()
? tbl.firstname
= "Michael
   
"
? isnotblank("tbl.firstname")
= .T.
tbl.change_begin(.t.)
tbl.firstname = ""
tbl.change_end(.t.)
? isnotblank("tbl.firstname")
= .F.

See Also