Progress
Programming
Handbook


Example Procedure

The following example defines a variable, position, to be viewed as a selection list:

p-sel1.p
DEFINE VARIABLE position AS CHARACTER LABEL "Position" INITIAL "Pitcher"
   VIEW-AS SELECTION-LIST INNER-CHARS 18 INNER-LINES 10
           LIST-ITEMS "Pitcher", "Catcher", "First Base", "Second Base",
                      "Third Base", "Shortstop", "Left Field",
                      "Center Field", "Right Field", "Designated Hitter".  

FORM
   position
   WITH FRAME sel-frame.

FORM
   position FORMAT "x(18)" VIEW-AS TEXT
   WITH FRAME text-frame.

ON GO OF FRAME sel-frame
   DO:
      ASSIGN position.
      DISPLAY position WITH FRAME text-frame.
   END.

DISPLAY position WITH FRAME sel-frame.
ENABLE position WITH FRAME sel-frame.
STATUS INPUT "Select a position and GO.".

WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW. 

The INNER–CHARS option specifies that items in the selection list are 18 characters wide. The INNER–LINES option specifies that 10 of the values are visible at a time. In this example, position has 10 possible values, so all values are always visible. When you press GO, the second frame displays position as a text field, as in the following example:


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