BLANK Command
Clears data from all fields in the current record when issued without additional arguments.
BLANK [FIELDS FieldList] [Scope] [FOR lExpression1] [WHILE lExpression2]
[NOOPTIMIZE] [IN nWorkArea | cTableAlias]
Parameters
FIELDS FieldList
Clears only the fields you specify with FieldList. If you omit the FIELDS clause, all fields in a record are cleared by default. Any field you specify in an unselected work area must be prefaced with the alias of the work area.Note BLANK does not clear field data of a record in another related work area if the record pointer is at the end of the file in the current work area. The record pointer must be on a record in the current work area in order for BLANK to act on the fields in the related record.
Scope
Specifies a range of records to clear. The default scope for BLANK is the current record (NEXT 1). Only the records that fall within the range are cleared.The scope clauses are: ALL, NEXT nRecords, RECORD nRecordNumber, and REST.
Commands that include the Scope parameter operate only on the table in the active work area.
For more information on scope clauses, see Scope Clauses.
FOR lExpression1
Clears field data in records for which lExpression1 evaluates to true (.T.). Rushmore Query Optimization optimizes BLANK FOR if lExpression1 is an optimizable expression. A discussion of Rushmore Query Optimization appears in Using Rushmore Query Optimization to Speed Data Access.WHILE lExpression2
Specifies a condition whereby field data in records is cleared as long as the logical expression lExpression2 evaluates to true (.T.).NOOPTIMIZE
Prevents Rushmore optimization of BLANK. For more information see SET OPTIMIZE and Using Rushmore Query Optimization to Speed Data Access.IN nWorkArea | cTableAlias
Specifies the workarea or table alias affected by the BLANK command. Use this clause to specify a workarea or a table outside the current work area.
Remarks
Use APPEND BLANK to add a new blank record to the end of a table. Use ISBLANK( ) to determine if a field in a record is blank.
Example
The following example opens the customer
table in the testdata
database. The contents of the first record are displayed. SCATTER is used to save the contents of the record to an array. The record is cleared with BLANK, and the contents of the record are displayed again. GATHER is used to restore the original record contents, and the restored record contents are displayed again.
CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'data\testdata')
USE customer && Open customer table
CLEAR
DISPLAY && Displays the current record
SCATTER TO gaCustomer && Create array with record contents
BLANK && Clear the record
DISPLAY && Displays the blank record
GATHER FROM gaCustomer && Restore original record contents
DISPLAY && Display the restored record
See Also
APPEND | EMPTY( ) | ISBLANK( ) | REPLACE | SET OPTIMIZE | Using Rushmore Query Optimization to Speed Data Access