Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

RE: Visual Cobol Linkage

$
0
0

Instead of passing data back and forth it might be best to define the data item as a property in the called program and then you can set and retrieve its value from either program using the property get/set syntax.

Example"

Calling Code

Working-Storage Section.
01 ws-custid-linkage     pic x(06).
method-id TbxCustId_KeyDown final private.
      Local-storage section.
      01 my-custsearchlist    type MPSSYSMAIN.CUSTSEARCHLISTForm1.
      procedure division using by value sender as object e as type System.Windows.Forms.KeyEventArgs.
             if e::"KeyCode"= type "System.Windows.Forms.Keys"::"Escape"
                     set my-custsearchlist to new CUSTSEARCHLISTForm1
                     set mycustsearchlist::custidproperty to ws-custid-linkage
                     invoke my-custsearchlist::ShowDialog(self)
               end-if
           *> after second form closed you can retrieve value using following
               set ws-custid-linkage to mycustsearchlist::custidproperty

Called Program

Working-Storage Section.
01 custidproperty     pic x(06) property.
      method-id NEW.
      procedure division..
          invoke self::InitializeComponent
          goback.

      end method.

      method-id ButExit_Click final private.
      procedure division using by value sender as object e as type System.EventArgs.
          set custidproperty to TexBoxSearch::Text
          invoke self::Close()
      end method.


Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>