PreviousNextIndex

DISPLAY statement

Moves data to a screen buffer and displays the data on the screen or other output destination. The AVM uses frames to display data. A frame describes how constant and variable data is arranged for display and data entry. You can let ABL construct default frames or you can explicitly describe frames and their characteristics.

Data movement

Syntax

DISPLAY 
  { [ STREAM stream | STREAM-HANDLE handle ] [ UNLESS-HIDDEN ] } 
  [    { expression 
             [ format-phrase ] 
             [ ( aggregate-phrase ) ] 
             [ WHEN expression ] 
             [ @base-field ] 
        } 
     |  [ SPACE [ ( n ) ] ] 
     |  [ SKIP [ ( n ) ] ] 
  ] ... 
  { [ IN WINDOW window ] [ frame-phrase ] [ NO-ERROR ] } 

DISPLAY 
  { [ STREAM stream | STREAM-HANDLE handle ] [ UNLESS-HIDDEN ] } 
     record [ EXCEPT field ... ] 
  { [ IN WINDOW window ] [ frame-phrase ] [ NO-ERROR ] } 

DISPLAY 
 {     expression ... 
    |  record [ EXCEPT field ... ] 
  } 
  WITH BROWSE browse [ NO-ERROR ] 

STREAM stream
STREAM-HANDLE handle
UNLESS-HIDDEN
expression
format-phrase
aggregate-phrase
WHEN expression
@ base-field
SPACE [ ( n ) ]
SKIP [ ( n ) ]
IN WINDOW window
frame-phrase
record
EXCEPT field . . .
WITH BROWSE browse
NO-ERROR
Examples

This procedure generates a hierarchical report of Customers (sorted by state and name), the orders belonging to those Customers, and the order-lines belonging to each order:

r-disp.p
FOR EACH Customer NO-LOCK BY Customer.State BY Customer.Name: 
  DISPLAY Customer.State Customer.CustNum Customer.Name. 
  FOR EACH Order OF Customer NO-LOCK: 
    DISPLAY Order.OrderNum Order.Name Order.ShipDate Order.PromiseDate. 
    FOR EACH OrderLine OF Order NO-LOCK, Item OF OrderLine NO-LOCK: 
      DISPLAY OrderLine.LineNum Item.ItemName OrderLine.Qty 
        OrderLline.price. 
    END. 
  END. 
END. 

This procedure lists each order, Customer information, and the OrderLines for each Order. The procedure calculates an Order-value for each of the OrderLines of an Order, and adds those values to produce a total value for an entire Order.

r-disp2.p
FOR EACH Order NO-LOCK, Customer OF Order NO-LOCK: 
  DISPLAY Order.OrderNum Customer.Name Order.ShipDate Order.PromiseDate. 
  FOR EACH OrderLine OF Order NO-LOCK, Item OF OrderLine NO-UNDO: 
    DISPLAY OrderLine.LineNum Item.ItemName OrderLine.Qty OrderLine.Price 
      OrderLine.Qty * OrderLine.Price (TOTAL) LABEL "Order-value". 
  END. 
END. 

The r-disp3.p procedure displays a name and address list in a mailing label. The SKIP and FORMAT options are used to produce a standard address format. The WHEN option suppresses the display of the PostalCode field if there is no postal code value in the field.

r-disp3.p
FOR EACH Customer NO-LOCK: 
  DISPLAY Customer.Name SKIP Customer.Address SKIP Customer.Address2 SKIP 
    Customer.City + ", " + Customer.State FORMAT "x(16)" 
    Customer.PostalCode WHEN Customer.PostalCode NE "" SKIP(2) 
    WITH NO-BOX NO-LABELS USE-TEXT. 
END. 

Notes
See also

ACCUM function, Aggregate phrase, DEFINE BROWSE statement, DEFINE FRAME statement, DOWN statement, EXPORT statement, FORM statement, Format phrase, Frame phrase, MESSAGE statement, PAGE statement, PUT statement, PUT SCREEN statement, Stream object handle, UP statement, VIEW-AS phrase


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex