Skip to main content

When i use the UNDERLINE clause with USING fields it doesn't display the UNDERLINE unless the cursor is at the field. Is there anyway to ALWAYS display the underline for these fields.

The first image is how it looks now. The second image is how i would like it to appear.

Thanks in advance for any help.

       working-storage section.
           01 ws-field-1   pic x(10).
           01 ws-field-2   pic x(10).
           01 ws-field-3   pic x(10).
           01 ws-field-4  pic x(10).
       screen section.
           01 my-screen.
           05  pic x(10) value "field-1" line 5 col 5.
         05 pic x(10) line 5 col 15 using ws-field-1 underline.
           05  pic x(10) value "field-2" line 7 col 5
           05  pic x(10) line 7 col 15 using ws-field-2 underline .
                                           
           05  pic x(10) value "field-3" line 9 col 5.
           05  pic x(10) line 9 col 15 using ws-field-3 underline .
           

       procedure division.
           
           display my-screen
           accept my-screen
           
           goback.


#COBOL
#adis
#VisualCOBOL

When i use the UNDERLINE clause with USING fields it doesn't display the UNDERLINE unless the cursor is at the field. Is there anyway to ALWAYS display the underline for these fields.

The first image is how it looks now. The second image is how i would like it to appear.

Thanks in advance for any help.

       working-storage section.
           01 ws-field-1   pic x(10).
           01 ws-field-2   pic x(10).
           01 ws-field-3   pic x(10).
           01 ws-field-4  pic x(10).
       screen section.
           01 my-screen.
           05  pic x(10) value "field-1" line 5 col 5.
         05 pic x(10) line 5 col 15 using ws-field-1 underline.
           05  pic x(10) value "field-2" line 7 col 5
           05  pic x(10) line 7 col 15 using ws-field-2 underline .
                                           
           05  pic x(10) value "field-3" line 9 col 5.
           05  pic x(10) line 9 col 15 using ws-field-3 underline .
           

       procedure division.
           
           display my-screen
           accept my-screen
           
           goback.


#COBOL
#adis
#VisualCOBOL

Underline is not supported if your application type is set to console application and you are compiling to an exe as a normal console window does not support this. If you change the type of application on the project properties Application tab to Windows Application then it should work.


Underline is not supported if your application type is set to console application and you are compiling to an exe as a normal console window does not support this. If you change the type of application on the project properties Application tab to Windows Application then it should work.

I changed Solution properties/Application/Output type to "Windows application" and, when i compile, i get an error that says;

Error COBCH1634 Extended ACCEPT/DISPLAY not allowed with a Windows GUI executable


I changed Solution properties/Application/Output type to "Windows application" and, when i compile, i get an error that says;

Error COBCH1634 Extended ACCEPT/DISPLAY not allowed with a Windows GUI executable

Chris's suggestion works if you build your application as native, not as managed. I also get the same issue as yours if I build the application as managed.


Chris's suggestion works if you build your application as native, not as managed. I also get the same issue as yours if I build the application as managed.

Thank you very much for your reply. How do i make it build my project as native?


Thank you very much for your reply. How do i make it build my project as native?

You need to select a different project type when you create the project. You must have selected one of the .NET templates which is managed code. Do you require managed code or was this by mistake?

To select a native Windows application choose the following from the list of templates:


You need to select a different project type when you create the project. You must have selected one of the .NET templates which is managed code. Do you require managed code or was this by mistake?

To select a native Windows application choose the following from the list of templates:

When i use that tremplate i get the following error message;

Error (11) Cannot find C runtime library COBOLLINK


When i use that tremplate i get the following error message;

Error (11) Cannot find C runtime library COBOLLINK

On further investigation i have found that i need to install all the other tools/features for viual studio for it to work. I'm not sure exactly which one solved the problem though.

Thank you both very much for your help, i do appreciate it.