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 ] }
|
Specifies the handle to a stream. If handle is not a valid handle to a stream, the AVM generates a run-time error. Note that stream handles are not valid for the unnamed streams. See the chapter on alternate I/O sources in
OpenEdge Development: Programming Interfaces for more information on streams and stream handles.
If expression is a simple field or variable, the AVM checks to see if that particular field or variable is used previously in the same frame. If it has, the AVM displays the field or variable in the same frame field as the earlier instance of that field or variable.
If you reference a[i] in the same frame that you reference a or
a[constant],
a[i] overlays the appropriate frame field based on the value of i. It is displayed in a new frame field for
a[i]. For example.
/*1*/ DEFINE VARIABLE ix AS INTEGER NO-UNDO.
/*2*/ FOR EACH SalesRep:
/*3*/ DISPLAY SalesRep.SalesRep SalesRep.Region SalesRep.MonthQuota.
/*4*/ DO ix = 1 TO 12:
/*5*/ SET SalesRep.MonthQuota[ix] WITH 1 COLUMN.
/*6*/ END.
/*7*/ DISPLAY SalesRep.MonthQuota
/*8*/ WITH FRAME a COLUMN 40 ROW 3 1 COLUMN.
/*9*/ END.
|
Here, month-quota[i] is referenced in the same frame that
month-quota is referenced. That is, line 5 references
month-quota[i] and line 3 references
month-quota. Both references use the same frame. Therefore, instead of creating a new frame field for
month-quota[i], the AVM uses the same frame fields created for the entire
month-quota array.
/*1*/ DEFINE VARIABLE ix AS INTEGER NO-UNDO.
/*2*/ FOR EACH SalesRep:
/*3*/ DISPLAY SalesRep.SalesRep SalesRep.Region
/*4*/ SalesRep.MonthQuota[1] SalesRep.MonthQuota[2].
/*5*/ DO ix = 1 TO 12:
/*6*/ SET month-quota[ix] WITH 1 COLUMN.
/*7*/ END.
/*8*/ DISPLAY month-quota WITH FRAME a COLUMN 40 ROW 3 1 COLUMN.
/*9*/ END.
|
/*1*/ DEFINE VARIABLE ix AS INTEGER NO-UNDO.
/*2*/ FOR EACH SalesRep:
/*3*/ DISPLAY SalesRep.SalesRep SalesRep.Region
/*4*/ SalesRep.MonthQuota[1] SalesRep.MonthQuota[2] WITH 6 DOWN.
/*5*/ FORM ix SalesRep.MonthQuota[ix].
/*6*/ DO ix = 1 TO 12:
/*7*/ DISPLAY ix NO-LABEL.
/*8*/ SET SalesRep.MonthQuota[ix].
/*9*/ END.
/*10*/ DISPLAY month-quota WITH FRAME a COLUMN 40 ROW 3 1 COLUMN.
/*11*/ END.
|
If you explicitly reference a[ix] in a FORM statement, regular array fields (
month-quota[1] and
month-quota[2] in this example) are not overlaid.
The base-field must be the name of a field or variable; it cannot be an expression or constant. The field or variable must be viewed as a fill-in or text widget on the display.
The AVM reserves enough space for the base-field to hold the longest format displayed there. All right-justified fields (numerics that do not use side labels) are right justified within the reserved area. The label is left or right justified according to the
base-field. Whenever you enter data into the
base-field, the AVM blanks out any characters to the left or right of the area used by the field being displayed.
Identifies the number (n) of blank spaces the AVM inserts after the displayed expression displays. The
n can be 0. If the number of spaces is more than the spaces left on the current line of the frame, the AVM starts a new line and discards extra spaces. If you do not use this option or do not use
n, the AVM inserts one space between items in the frame.
Identifies the number (n) of blank lines the AVM needs to insert after the expression is displayed. The
n can be 0. If you do not use this option, the AVM does not skip a line between expressions unless the expressions do not fit on one line. If you use the SKIP option but do not specify
n, or if
n is 0, the AVM starts a new line unless it is already at the beginning of a new line.
Suppresses ABL errors or error messages that would otherwise occur and diverts them to the
ERROR-STATUS system handle. If an error occurs, the action of the statement is not done and execution continues with the next statement. If the statement fails, any persistent side-effects of the statement are backed out. If the statement includes an expression that contains other executable elements, like methods, the work performed by these elements may or may not be done, depending on the order the AVM resolves the expression elements and the occurrence of the error.
|
Check if the ERROR-STATUS:NUM-MESSAGES attribute is greater than zero to see if the AVM generated error messages. ABL handle methods used in a block without a CATCH end block treat errors as warnings and do not raise ERROR, do not set the ERROR-STATUS:ERROR attribute, but do add messages to the ERROR-STATUS system handle. Therefore, this test is the better test for code using handle methods without CATCH end blocks. ABL handle methods used in a block with a CATCH end block raise ERROR and add messages to the error object generated by the AVM. In this case, the AVM does not update the ERROR-STATUS system handle.
|
|
A CATCH statement, which introduces a CATCH end block, is analogous to a NO-ERROR option in that it also suppresses errors, but it does so for an entire block of code. It is different in that the error messages are contained in a class-based error object (generated by the AVM or explicitly thrown), as opposed to the ERROR-STATUS system handle. Also, if errors raised in the block are not handled by a compatible CATCH block, ON ERROR phrase, or UNDO statement, then the error is not suppressed, but handled with the default error processing for that block type.
|
|
When a statement contains the NO-ERROR option and resides in a block with a CATCH end block, the NO-ERROR option takes precedence over the CATCH block. That is, an error raised on the statement with the NO-ERROR option will not be handled by a compatible CATCH end block. The error is redirected to the ERROR-STATUS system handle as normal.
|
|
If an error object is thrown to a statement that includes the NO-ERROR option, then the information and messages in the error object will be used to set the ERROR-STATUS system handle. This interoperability feature is important for those integrating code that uses the traditional NO-ERROR technique with the newer, structured error handling that features error objects and CATCH end blocks.
|
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.
|
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.
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.
|
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