Try OpenEdge Now
skip to main content
ABL Reference
ABL Syntax Reference : DOWN statement

DOWN statement

Positions the cursor on a new line in a down or multi-line frame.
When the block specifying the down frame iterates, the AVM automatically advances one frame line. Use the DOWN statement if you want to move to a different display line at any time.
For more information on down frames, see the DOWN option of the Frame phrase.
Note: Does not apply to SpeedScript programming.


DOWN [ STREAM stream | STREAM-HANDLE handle ] [ expression ]
     { [frame-phrase ] }
STREAM stream
Specifies the name of a stream. If you do not name a stream, the AVM uses the unnamed stream. See the DEFINE STREAM statement reference entry and the "Alternate I/O Sources" chapter in OpenEdge Development: Programming Interfaces for more information on streams.
Specifies the handle to a stream. If handle it 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.
The number of occurrences of data in the frame that you want to move down.
DOWN is the same as DOWN 1, except for the following:
*Nothing happens until a data handling statement affects the screen.
*Several DOWN statements in a row with no intervening displays are treated as a single DOWN 1.
DOWN 0 does nothing. If n is negative, the result is the same as UP ABS(n).
Specifies the overall layout and processing properties of a frame. For more information on frame-phrase, see the Frame phrase reference entry.


This procedure prints a Customer report that is sorted by State, with one line after the last Customer in each state:

FOR EACH Customer NO-LOCK BY Customer.State:
  IF Customer.State <> laststate THEN DO:
    IF laststate <> "" THEN DOWN 1.
    laststate = Customer.State.
  DISPLAY Customer.CustNum Customer.Name Customer.City Customer.State.


*After displaying a down frame, the AVM automatically advances to the next frame line on each iteration of the block where the frame belongs. This is true whether or not you use the DOWN statement. If you do not want the AVM to advance automatically, name the frame outside of the block involved (the statement FORM WITH FRAME frame names a frame and scopes that frame to the higher block).
*When the AVM reaches the last frame line and encounters a DOWN statement, it clears the frame and starts at the top line of the frame, unless you used the SCROLL option on the frame. In that case, the AVM scrolls the frame up one iteration only, to make room for the next iteration.

See also

DEFINE STREAM statement, Frame phrase, SCROLL statement, Stream object handle, UP statement