ComboBox

Hello, I have a problem I need to fill a ComboBox in various programs, I was thinking about making a routine which would read the file and fills the ComboBox of the program that called this routine is to do this, thank you

Parents
  •       Sorry that I changed the routine and was

              class-id EncheCombos.Class1.

          working-storage section.

          77  fs pic x(002).

          01  Lnk-Parametros.

              03  Lnk-Fim             pic 9(001).

              03  Lnk-CodCliente      pic 9(005).

              03  Lnk-NomeCliente     pic x(050).

          method-id InstanceMethod.

          local-storage section.

          procedure division.

              declare fl as type bindcombo.fillList = new bindcombo.fillList

              goback.

          end method.

          end class.

          class-id bindcombo.fillList.

              select item-file assign to "itemfile.txt"

                               organization is line sequential

                               file status is file-status.

          file section.

          fd item-file.

          01 item-record  pic x(80).

          working-storage section.

          01 file-status  pic x(2) value spaces.

          method-id getList.

          local-storage section.

          procedure division returning mylist as list[string].

              open input item-file

              create mylist

              perform until exit

                 read item-file

                    at end

                       exit perform

                    not at end

                       write mylist from item-record

                 end-read

              end-perform

              close item-file

              invoke type MessageBox::Show("Processo Concluído")

              goback.

          end method.

          end class.

Reply
  •       Sorry that I changed the routine and was

              class-id EncheCombos.Class1.

          working-storage section.

          77  fs pic x(002).

          01  Lnk-Parametros.

              03  Lnk-Fim             pic 9(001).

              03  Lnk-CodCliente      pic 9(005).

              03  Lnk-NomeCliente     pic x(050).

          method-id InstanceMethod.

          local-storage section.

          procedure division.

              declare fl as type bindcombo.fillList = new bindcombo.fillList

              goback.

          end method.

          end class.

          class-id bindcombo.fillList.

              select item-file assign to "itemfile.txt"

                               organization is line sequential

                               file status is file-status.

          file section.

          fd item-file.

          01 item-record  pic x(80).

          working-storage section.

          01 file-status  pic x(2) value spaces.

          method-id getList.

          local-storage section.

          procedure division returning mylist as list[string].

              open input item-file

              create mylist

              perform until exit

                 read item-file

                    at end

                       exit perform

                    not at end

                       write mylist from item-record

                 end-read

              end-perform

              close item-file

              invoke type MessageBox::Show("Processo Concluído")

              goback.

          end method.

          end class.

Children
No Data