Progress
Programming
Handbook


Positioning Frames with FRAME–DOWN

The FRAME–DOWN function returns the number of iterations that can fit in a frame. You can use this function to determine if a down frame is full. Then Progress can perform an action based on the value of FRAME–DOWN.

For example, you can display all the customers in the database, which takes several screens. If the customer you want to see is on the first screen, it is time-consuming to press RETURN until every customer in the database is listed and the procedure ends. The following procedure uses the FRAME–DOWN function to solve this problem:

p-frdown.p
DEFINE VARIABLE ans AS LOGICAL.

FOR EACH customer:
  DISPLAY cust-num name credit-limit.
  IF FRAME-LINE = FRAME-DOWN
  THEN DO:
    MESSAGE "Do you want to see the next page?" VIEW-AS ALERT-BOX
         QUESTION BUTTONS YES-NO TITLE "Screen Full"
         UPDATE ans.
    IF NOT ans
    THEN LEAVE.
  END.
END. 

This procedure produces the following output:

Each time the frame becomes full, the question “Do you want to see the next page?” appears in a dialog box. If you answer No, the procedure ends.

In this procedure, the FRAME–DOWN function returns the number of iterations that can fit in a frame, and the FRAME–LINE function returns the current logical line in a frame. When the current logical line equals the number of lines in the frame, the procedure displays the message “Do you want to see the next page?” and gives the user the option to continue or to end the procedure.

Note that the DOWN and LINE attributes are analogous to the FRAME–DOWN and FRAME–LINE functions.

See the Progress Language Reference for more information on these functions and attributes.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095