How can i get the value of a selection in a combo box ?

make

Member
Hi,
i am an absolut newbie in Progress programming. And now i have my first problem. I have filled a combo-box, but i dont know how i can get the value of a item wich i select in the combo.
Can anyone help me.? If you can.... please give me short code example.

Thanks

make
 

jongpau

Member
Hi Make,

Just like with fill-in widgets, you can use the "screen-value" attribute. For instance (a slapped together example):
Code:
DEF BUTTON btnTest  LABEL "&Show Me":L SIZE-PIXELS 75 BY 21.
DEF BUTTON btnClose LABEL "&Close":L   SIZE-PIXELS 75 BY 21 AUTO-ENDKEY.

DEF VAR cbTest AS INT FORMAT "99":U LABEL "Select a &value":L INITIAL 1
    VIEW-AS COMBO-BOX LIST-ITEM-PAIRS "One":L,1,"Two":L,2,"Three":L,3,"Four":L,4
            INNER-LINES 3.

FORM SKIP(1)
     SPACE(1) cBTest  SKIP(1)
     SPACE(1) btnTest 
     SPACE(1) btnClose
     WITH FRAME FrmTest DEFAULT-BUTTON btnTest 
          SIDE-LABELS VIEW-AS DIALOG-BOX THREE-D TITLE "Just a Test":L.

ON 'CHOOSE':U OF btnTest
DO:
  MESSAGE [b]cbTest:SCREEN-VALUE[/b]
          VIEW-AS ALERT-BOX INFORMATION.
END.

VIEW FRAME FrmTest.
DISPLAY cbTest WITH FRAME FrmTest.
ENABLE ALL WITH FRAME FrmTest.

WAIT-FOR GO OF FRAME FrmTest.
HTH.
 
Top