Command DISPLAY Foundation
Outputs records and/or displays them on the screen.
DISPLAY <Expression,...> ;
[FOR <lForCondition>] ;
[WHILE <lWhileCondition>] ;
[NEXT <nCount>] ;
[RECORD <xRecordID>] ;
[TO FILE <cFilename>] ;
[TO PRINTER] ;
[REST] ;
[ALL] ;
[OFF]
The command DISPLAY outputs the values of the expression list <Expression,...> in table form. The values are separated by blank spaces. DISPLAY does not display any column headings and sequentially processes the records in the current work area. The result of the expression list is output for each record matching the condition up to the specified record count. DISPLAY differs from many other commands in that the default scope is NEXT 1, not ALL. During the output of records, the display is not paused, but continues scrolling. DISPLAY is identical to the command LIST except for the default scope of records. The default for LIST is ALL.
The command DISPLAY outputs the values of <Expression,...> to the screen. The output can also be sent to the printer or to a file using the options TO PRINTER or TO FILE. To suppress the screen output, the command SET CONSOLE OFF must be called before call to DISPLAY.
records with deletion flags are only output when SET DELETED is turned OFF. In this case, the deletion flag is identified with an asterisk (*) in the output.
// The example shows a simple listing of records
// from an invoice file. The output occurs on the screen
// and the printer.
PROCEDURE Main
USE Invoice NEW
DISPLAY "Unpaid invoices", Date(), Time() TO PRINTER
DISPLAY InvDate, PartNo, Payment TO PRINTER ;
FOR Payment == 0
USE
RETURN
// The example shows how the screen display can be paused
// after each MaxRow() rows are output and how the option to terminate
// output using the Esc key can be implemented.
#include "Inkey.ch"
PROCEDURE Main
LOCAL nCount := 0
USE Customer NEW
DISPLAY LName, FName, Phone ;
WHILE IIf( ++nCount % MaxRow()==0, Inkey(0)<>K_ESC, .T. )
USE
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.