display line x position y index out of bounds

I have a simple cobol console program using visual studio 2017 (running visual cobol 2017)

display "ackack" line 4 position 10.

this throws an "index out of range exception"

this syntax worked with Visual Cobol 2015.

Am I missing something in the docs?

  • I created a simple program that only does the display you specify and it works fine in both a native and a managed console application in Visual COBOL 3.0 with Patch Update 7 applied for Visual Studio 2017.

    What Patch Update level do you have applied and does this fail when only the single display statement is present or is there more to your program?
    What compiler directives are you using?
  • Hi Chris. I have the latest patches for VS2017. I am using these directives.

    anim cobidy"C:\builds\NCRFinal\binaries\debug" sourceformat"Variable" nowarning max-error"100" ilgen noint

    This fails on the first display that has a line and position specified.
  • I also created an empty cobol console application and tried to display with line and position. The same error occurred.
    Perhaps there is something wrong with my installation?
  • So this is managed code. What OS are you running in? You might try to do a Repair of the VC installation.
  • yes, managed code. I am running windows 10 1803. I ran the repair on the installer and now visual studio does not have cobol installed at all.
  • I installed and reinstalled Visual Cobol 2017 with patch 7 and am still seeing the same error. Are there any dependencies I need to install, perhaps a specific .net version?
  • One of our customers just reported the exact same issue. I was unable to recreate the problem, and the difference came down to the version of Windows 10. He is using Windows 10 version 1803 while mine is Windows 10 version 1709. I am sure Chris's machine is still running Windows 10 version 1709 like mine. I will run some tests and will let you know if I can recreate it with Windows 10 version 1803.
  • Just to add my 2 cents worth. I created a simple managed Cobol program which worked fine. I am running Visual Cobol 3.0 (with patches as of April) on Visual Studio Community 2017 version 15.7.2 (the most recent version) and Windows 10 build 1803.

    When I Start without debugging the following code, I get the expected message and "Press any key to continue..."

    program-id. Program1 as "SimpleDisplay.Program1".

    data division.
    working-storage section.

    procedure division.
    display "Hello World" at line 4 position 11.

    end program Program1.

    I am using the following directives: "anim cobidy".\bin\Debug\" sourceformat"Variable" warnings"1" max-error"100" ilgen noint constant"DEBUG(1)""
  • So I have an update from our Release Management team which may be the reason behind the issue that you are reporting.

    During testing of our 4.0 product version we have been testing the insider (up and coming) versions of Windows and identified issues with .NET.

    The summary is that the first update to 1803 installs a .NET jitter for 4.7.2 which appears to have some issues. We reported this to Microsoft and found that a fix would be inbound in some shape or form and looks like this week MS pushed out an update that addresses the problem we were seeing. Unfortunately there is no mention of affecting changes in the KB update.

    This in theory means there is a small window where we may experience issues.

    So it looks like there was a problem introduced in 1803 which has been fixed in an update that came out this week.
    Please try running Windows Updates to see if the patch is now available to you.

  • 1803 is the version number of Windows 10. Can you tell us the build number you are on? Is it 17134.1, 17134.48, 17134.81, or else?