I'm new to the whole concept of a screen section in gnucobol and I'm playing around with a couple of examples I've found on the web to see if I can use the screen section to display data on the screen (works fine) and then receive data keyed in by the user into my program for processing. At this point I have the display working fine, but I'm having problems receiving data back from it. Attached is my test code and a snap shot of my results. Any help would be appreciated! Thank you!
Add foreground-color xxx background-color yyy where xxx and yyy is the color required having a 'COPY "screenio.cpy" in WS area at SS 01 level data-name so it looks something like :
Thank you. That helps a lot. I have the user inputted data from the screen working now (in black and white) but when I add the 01 for the colors my editor gives me syntax errors on both the 01 and 03 levels ("unexpected identifier" and "unexpected using"). It seems to work fine without that defined in WS. Also, can you tell me what COPY "screenio.cpy" is and what it does? Thanks again. I really appreciate your help.
the COPY file "screenio.cpy" is under your GnuCOBOL installation in the copy directory.
At me C:\GC32M-BDB-x64\copy\screenio.cpy. It includes some predefined values.
BR
László
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2025-07-14
That makes sense - thank you!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2025-07-14
Thank you. The sample.cob you uploaded seems to be the same one I uploaded. Line for line I didn't see any difference. Did I miss something? Thank you!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm new to the whole concept of a screen section in gnucobol and I'm playing around with a couple of examples I've found on the web to see if I can use the screen section to display data on the screen (works fine) and then receive data keyed in by the user into my program for processing. At this point I have the display working fine, but I'm having problems receiving data back from it. Attached is my test code and a snap shot of my results. Any help would be appreciated! Thank you!
Providing a copy of the source program might help a lot more than the snapshot of the screen image.
So sorry - I did upload it, but the screen shot must have overlayed it? Thank you!
Few you have missed : -
In my example I have difffering foreground colors but if it is the same for all include it at the 01 level.
The accept will display the screen as at the 01 level then request the data shown as USING.
Thank you. That helps a lot. I have the user inputted data from the screen working now (in black and white) but when I add the 01 for the colors my editor gives me syntax errors on both the 01 and 03 levels ("unexpected identifier" and "unexpected using"). It seems to work fine without that defined in WS. Also, can you tell me what COPY "screenio.cpy" is and what it does? Thanks again. I really appreciate your help.
Hi,
the COPY file "screenio.cpy" is under your GnuCOBOL installation in the copy directory.
At me C:\GC32M-BDB-x64\copy\screenio.cpy. It includes some predefined values.
BR
László
That makes sense - thank you!
Try these changes - attached.
Thank you. The sample.cob you uploaded seems to be the same one I uploaded. Line for line I didn't see any difference. Did I miss something? Thank you!
Look closer - there are differences in SS and PD.
Nice - thank you! Works great! I really appreciate your patience and help!
screenio.cpy includes all of the definotions for the colors used in GnuCobol.
Suggest you download and read the Programmers Guide.
You can access it and the others at :
https://gnucobol.sourceforge.io/guides.html
Please ensure you log in to SF every time as it can be some time before some one will who is a moderator can see your post and accept it.
Thank you!