Click or drag to resize

IsBlank Function

X#
-- todo --
Determines whether an expression is blank.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.21
Syntax
 FUNCTION IsBlank(
	eExpression
) AS LOGIC CLIPPER
Request Example View Source

Parameters

eExpression (Optional)
Type: Usual
Specifies the expression for IsBlank( ) to evaluate. eExpression can be a field in a table, a variable or array element, or an expression.

Return Value

Type: Logic
Logical. IsBlank( ) returns True (.T.) if the expression eExpression is blank; otherwise, IsBlank( ) returns False (.F.).
IsBlank( ) returns True (.T.) for fields when those fields contain certain values. The table below lists the values that field types contain for IsBlank( ) to return True.
Data typeValues the field contains
BlobEmpty (0h) or contains only zero bytes, for example, 0h00, 0h000000, and so on
Character Empty string, spaces, or no value, such as a newly appended blank record or cleared with Blank
Date Blank date ({ / / }) or no value, such as a newly appended blank record or cleared with Blank
DateTime Blank datetime ({ / / : : }) or no value, such as a newly appended blank record or cleared with Blank
Float No value, such as a newly appended blank record or cleared with Blank
GeneralEmpty, for example, no OLE object
Logical No value, such as a newly appended blank record or cleared with Blank
MemoEmpty, for example, no memo contents
Numeric No value, such as a newly appended blank record or cleared with Blank
VarbinaryEmpty (0h) or contains only zero bytes, for example, 0h00, 0h000000, and so on
Note Note
Expressions with Currency, Integer, or Double type are never blank; therefore, IsBlank( ) always returns False (.F.) for these expression types.
Remarks
To create a blank record, use the Append Blank and Blank commands. You can also use Blank to clear data from fields in a record.
IsBlank( ) differs from Empty( ) and IsNull( ). For example, Empty( ) returns True (.T.) if a character expression evaluates to empty, for example, it contains spaces, tabs, carriage returns, or line feeds. IsBlank( ) returns True (.T.) if the character expression contains only the empty string ("") or spaces.
Examples
X#
1Create Table mytable FREE (myfield C(20))
2Append Blank  // Add new blank record
3Clear
4? ISBlank(myfield)  // Displays .T.
5Replace myfield WITH 'John Smith'  // Insert a value in the field
6? ISBlank(myfield)  // Displays .F.
See Also