COBOL Source Format of invoked program when in Debug

In Visual Studio 2013, Visual COBOL 2.2. ...

When you have Managed WinForms Program A invoking Managed WinForms Program B, and both are in variable source format as shown by the VS editor when editing each individually... and you are running in Debugging mode... when A invokes B and you are transitioned over to B... it appears in the old fixed Source format, with the right margin area greyed out...

Thanks.

  • Hi Austin1,

    Can you provide more detail please? What exactly are you invoking here? Are these two programs in the same project or in different projects? Are these COBOL programs or classes?

    Can you show an example of the invoke?

    Thanks.

  • 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.

  • I don't believe this is specific to WinForms. I see it in the VS debugger all the time - the debugger source view is in fixed format, regardless of the source format set in the project settings, and so e.g. mousing over variable names that extend past the right margin doesn't work. I've never found a fix (though I haven't tried very hard, either); I just use the Auto / Local / Watch windows to view variables.

  • Verified Answer

    Austin1,

    I can reproduce the problem when the referenced project or assembly does not exist within the current solution. If I move it within the current solution then the sourceformat does not change.

    If you would like to open a support incident for this and add my name in the description then I would be glad to create a bug report and get it fixed in a future release?

    Thanks.