Skip to main content

RTS 192 from CBL_ALLOC_MEM

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

If lines are entered into a Multi Line TextBox similar to the following:

Line1

Line2

Line3

Line4

then how is access to each of the individual lines in the control accomplished?

Resolution:

On a TextBox there is a "Text" property that provides access to all the text wtih x"0d0a" delimiters (Carride Return/ LineFeeds) between the lines. The user could retrieve the test to a pic x(..) and then UNSTRING the data as required.

Alternatively there is a "Lines" property that is an array of the lines.

The following code example might prove useful :

          *****> Access each line in the MultiLine TextBox

          *****> and add it to a ListBox

                        perform varying ls-str through textBox1::"Lines"

                                invoke listbox1::"Items"::"Add"(ls-str)

                        end-perform

This used the "perform through" syntax that is a .Net extension to the COBOL language. It permits iteration through a collection or array.

Old KB# 5292

0 replies

Be the first to reply!