Skip to main content

[archive] Combo-box

  • August 9, 2005
  • 4 replies
  • 0 views

[Migrated content. Thread originally posted on 08 August 2005]


        01 CLIENT-TABLE OCCURS 100.
             05 CLIENT-ALPHACODE       X(15).
             05 FILLER                 X(3).
             05 CLIENT-NAME            X(35).


Example Combo-box :
IMPERIAL IMPERIAL
IMPERIAL IMPERIAL MEAT COMPANY

If a combo-box is filled with the above data, and there are different CLIENT-ALPHACODE that are the same ... if you choose the second CLIENT-ALPHACODE, the combobox allways returns as if you selected the first CLIENT-ALPHACODE.

How come and what to do about it ?

4 replies

[Migrated content. Thread originally posted on 08 August 2005]


        01 CLIENT-TABLE OCCURS 100.
             05 CLIENT-ALPHACODE       X(15).
             05 FILLER                 X(3).
             05 CLIENT-NAME            X(35).


Example Combo-box :
IMPERIAL IMPERIAL
IMPERIAL IMPERIAL MEAT COMPANY

If a combo-box is filled with the above data, and there are different CLIENT-ALPHACODE that are the same ... if you choose the second CLIENT-ALPHACODE, the combobox allways returns as if you selected the first CLIENT-ALPHACODE.

How come and what to do about it ?
How are you testing for the value 'returned' by the combo-box?

Are you using the VALUE field or the SELECTION-INDEX number?

Obviously, if you are using the VALUE of the combo-box then it will be the same for both the records you've shown.

Using the SELECTION-INDEX should always yield the actual line number within the list that you selected.

[Migrated content. Thread originally posted on 08 August 2005]


        01 CLIENT-TABLE OCCURS 100.
             05 CLIENT-ALPHACODE       X(15).
             05 FILLER                 X(3).
             05 CLIENT-NAME            X(35).


Example Combo-box :
IMPERIAL IMPERIAL
IMPERIAL IMPERIAL MEAT COMPANY

If a combo-box is filled with the above data, and there are different CLIENT-ALPHACODE that are the same ... if you choose the second CLIENT-ALPHACODE, the combobox allways returns as if you selected the first CLIENT-ALPHACODE.

How come and what to do about it ?
I just press F4 to open the list of the combo-box.

There I see then for example :
IMPERIAL IMPERIAL
IMPERIAL IMPERIAL MEAT

When you want to go to 'IMPERIAL IMPERIAL MEAT' with your cursor, it jumps back to 'IMPERIAL IMPERIAL'.

Strange behavior or not ?

[Migrated content. Thread originally posted on 08 August 2005]


        01 CLIENT-TABLE OCCURS 100.
             05 CLIENT-ALPHACODE       X(15).
             05 FILLER                 X(3).
             05 CLIENT-NAME            X(35).


Example Combo-box :
IMPERIAL IMPERIAL
IMPERIAL IMPERIAL MEAT COMPANY

If a combo-box is filled with the above data, and there are different CLIENT-ALPHACODE that are the same ... if you choose the second CLIENT-ALPHACODE, the combobox allways returns as if you selected the first CLIENT-ALPHACODE.

How come and what to do about it ?
How is the combo box defined in the screen section?

[Migrated content. Thread originally posted on 08 August 2005]


        01 CLIENT-TABLE OCCURS 100.
             05 CLIENT-ALPHACODE       X(15).
             05 FILLER                 X(3).
             05 CLIENT-NAME            X(35).


Example Combo-box :
IMPERIAL IMPERIAL
IMPERIAL IMPERIAL MEAT COMPANY

If a combo-box is filled with the above data, and there are different CLIENT-ALPHACODE that are the same ... if you choose the second CLIENT-ALPHACODE, the combobox allways returns as if you selected the first CLIENT-ALPHACODE.

How come and what to do about it ?
I have a problem, when I read from the file I want to display wherever I have in my file in the combo-box but always it shows me the 3rd one CSV

working-storage

01 combo-box-choices.
03 pic x(03) value "PDF".
03 pic x(03) value "rpt".
03 pic x(03) value "CSV".
03 pic x(03) value "TXT".
78 number-of-combo-choices value 4.

01 combo-choice
redefines combo-box-choices
occurs number-of-combo-choices times
indexed by combo-idx pic x(3).

77 add-item-1 pic x(03).


01 combo-data-1 pic x(03).


........
screen section.

01 screen-1
03 combo-1 combo-box using combo-data-1
column 2 lines 5 size 9
notify-selchange,
mass-update = fast-update-flag
exception procedure disp-elem.
...

procedure division.
..

modify combo-1, item-to-add = table combo-choice.
...

when I read my file
move file-field-1 to combo-data-1.
display screen-1.

disp-elem section.
move combo-data-1 to file-field-1.
display screen-1.
disp-elem-exit.
exit.




Doesn't show me the file-field that I read.
combo-1 is showing me the 3rd combo-box-choices CSV

can somebody help me, what is wrong?