Displays record contents and expression results for the current table in the main Visual FoxPro window or a user-defined window.

DISPLAY [[FIELDS] FieldList] [Scope] [FOR lExpression1] 


[[FIELDS] FieldList]

Specifies the fields to display. If you omit the FIELDS clause, all fields from the table display by default.


Memo field contents do not display unless the memo field name is explicitly included in the field list. The displayed width of memo fields is determined by the SET MEMOWIDTH command. For more information, see SET MEMOWIDTH Command.


Specifies a range of records to display. Only those records that fall within the scope range display. The default scope for DISPLAY is the current record (NEXT 1). For more information about scope clauses, see Scope Clauses.


Commands that include Scope operate only on the table in the active work area.

[FOR lExpression1]

Specifies to display only those records that satisfy the logical condition lExpression1. Expressions can consist of combinations of literals, memory variables, array elements, fields, and memo fields.

If lExpression1 can be optimized, Rushmore Query Optimization optimizes a query created with DISPLAY ... FOR. For best performance, use an expression that can be optimized in the FOR clause. For more information, see SET OPTIMIZE Command and Using Rushmore Query Optimization to Speed Data Access.

[WHILE lExpression2]

Specifies a condition to display records as long as the logical expression lExpression2 evaluates to True (.T.).


Suppresses display of record numbers. If you omit OFF, the record number displays preceding each record.


Suppresses output to the main Visual FoxPro window or to the active user-defined window.


Disables Rushmore optimization for DISPLAY. For more information, see SET OPTIMIZE Command and Using Rushmore Query Optimization to Speed Data Access.


Directs output from DISPLAY to a printer.

The PROMPT keyword specifies to display a Print dialog box before printing starts. The printer settings that you can adjust depend on the currently installed printer driver.


Directs output from DISPLAY to the file specified with FileName. If the file already exists, and SET SAFETY is ON, Visual FoxPro prompts you to choose whether to overwrite the file.

The ADDITIVE keyword appends output to the end of the specified file. If you omit ADDITIVE, Visual FoxPro overwrites the file with the value of the expression.

Expand imageRemarks

Expand imageExample

Expand imageSee Also

© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic