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

RE: COBOL Source Format of invoked program when in Debug

$
0
0

Separate Solutions.  Nothing really unusual. Just step thru it in Visual Studio debug mode and watch the source margin on the right go from white to grey as it transitions to the invoked program (class) and then back to white when it returns to the original program (class).  No harm done; just cosmetic.  In cblTest1, I added a reference to cblTest2, and they are both compiling to the same output path.

cblTest1 (Windows Application):

      class-id cblTest1.Form1 is partial

                inherits type System.Windows.Forms.Form.

      working-storage section.

      01  prog2                       type cblTest2.Form1.    *> add a Reference to this...

      method-id NEW.

      procedure division.

          invoke self::InitializeComponent

          goback.

      end method.

      method-id Form1_Load final private.

      procedure division using by value sender as object e as type System.EventArgs.

          set self::Font = new Font(self::Font, type FontStyle::Bold)

          set textBox1::Text = "Initial default data".

          invoke textBox1::Select(textbox1::Text::Length,0)

      end method.

      method-id button1_Click final private.

      procedure division using by value sender as object e as type System.EventArgs.

          set prog2                   to new cblTest2.Form1.

          set prog2::passed-info      to textBox1::Text.

          invoke prog2::ShowDialog.

          set textBox1::Text          to prog2::passed-info.  *> now back from invoked program

      end method.

      end class.

cblTest2 (Started out as a Windows App; changed to a Class Library):

      class-id cblTest2.Form1 is partial

                inherits type System.Windows.Forms.Form.

      working-storage section.

      01  passed-info                 string property.  

      method-id NEW.

      procedure division.

          invoke self::InitializeComponent

          goback.

      end method.

      method-id Form1_Load final private.

      procedure division using by value sender as object e as type System.EventArgs.

          set self::Font = new Font(self::Font, type FontStyle::Bold)

          set textBox1::Text          to passed-info.

          invoke textBox1::Select(textbox1::Text::Length,0)

      end method.

      method-id button1_Click final private.

      procedure division using by value sender as object e as type System.EventArgs.

          set passed-info             to textBox1::Text.

          invoke self::Close().

      end method.

      end class.


Viewing all articles
Browse latest Browse all 4356

Trending Articles



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