Discussion:
The option to the Cobol foreground-color/background-color options
(too old to reply)
Jan-Erik Söderholm
2021-08-14 12:43:15 UTC
Permalink
Hi.

When defining screens using the "screen section" in Cobol,
one can add "foreground-color is n" and "background-color is n".

Now, the numeric parameter n has valid values between 0 and 7.
But our terminal emulator (and the ANSI/VT ESC sequence standard)
has 16 settings. In our emulator (Extra!) they are 0-15.

0="black"
7="white"
15="bright white"

If I try to set the value to 15 I get:


%COBOL-F-SCRCOLVAL, FOREGROUND-COLOR or BACKGROUND-COLOR clause
value must be between 0 and 7 inclusive.

We are looking at options like redefining "colour 7" in Extra!
to be 255,255,255 (pure white) instead of the current 192,192,192
which results in a light grey background.

I'll ask VSI directly also if this restriction can be expanded
to include all colour options as can be seen here:
https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
but thought I'd just ask if someone have seen this before
and might have some other solution.

Regards,
Jan-Erik.
Jan-Erik Söderholm
2021-08-14 14:46:42 UTC
Permalink
Post by Jan-Erik Söderholm
Hi.
When defining screens using the "screen section" in Cobol,
one can add "foreground-color is n" and "background-color is n".
Now, the numeric parameter n has valid values between 0 and 7.
But our terminal emulator (and the ANSI/VT ESC sequence standard)
has 16 settings. In our emulator (Extra!) they are 0-15.
0="black"
7="white"
15="bright white"
%COBOL-F-SCRCOLVAL, FOREGROUND-COLOR or BACKGROUND-COLOR clause
  value must be between 0 and 7 inclusive.
We are looking at options like redefining "colour 7" in Extra!
to be 255,255,255 (pure white) instead of the current 192,192,192
which results in a light grey background.
I'll ask VSI directly also if this restriction can be expanded
https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
but thought I'd just ask if someone have seen this before
and might have some other solution.
Regards,
Jan-Erik.
I have added one additional request to VSI. An option in the
"screen section" that simply disables all colour changing
commands from the compiler. Our default colours in the
terminal emulator are OK and do not need any changes.

Something like:

screen section.
01 scrPageHeader blank screen no-color-changes.
02 value "Hello world - Screen section" line 2 column 1.

Or something similar...
Dave Froble
2021-08-14 16:00:27 UTC
Permalink
Post by Jan-Erik Söderholm
Post by Jan-Erik Söderholm
Hi.
When defining screens using the "screen section" in Cobol,
one can add "foreground-color is n" and "background-color is n".
Now, the numeric parameter n has valid values between 0 and 7.
But our terminal emulator (and the ANSI/VT ESC sequence standard)
has 16 settings. In our emulator (Extra!) they are 0-15.
0="black"
7="white"
15="bright white"
%COBOL-F-SCRCOLVAL, FOREGROUND-COLOR or BACKGROUND-COLOR clause
value must be between 0 and 7 inclusive.
We are looking at options like redefining "colour 7" in Extra!
to be 255,255,255 (pure white) instead of the current 192,192,192
which results in a light grey background.
I'll ask VSI directly also if this restriction can be expanded
https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
but thought I'd just ask if someone have seen this before
and might have some other solution.
Regards,
Jan-Erik.
I have added one additional request to VSI. An option in the
"screen section" that simply disables all colour changing
commands from the compiler. Our default colours in the
terminal emulator are OK and do not need any changes.
screen section.
01 scrPageHeader blank screen no-color-changes.
02 value "Hello world - Screen section" line 2 column 1.
Or something similar...
So what you're saying is that Cobol knows better than you what the
screen colors should be?

Got to wonder how that survived this long ...
--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: ***@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486
Jan-Erik Söderholm
2021-08-14 16:09:19 UTC
Permalink
Post by Jan-Erik Söderholm
Post by Jan-Erik Söderholm
Hi.
When defining screens using the "screen section" in Cobol,
one can add "foreground-color is n" and "background-color is n".
Now, the numeric parameter n has valid values between 0 and 7.
But our terminal emulator (and the ANSI/VT ESC sequence standard)
has 16 settings. In our emulator (Extra!) they are 0-15.
0="black"
7="white"
15="bright white"
%COBOL-F-SCRCOLVAL, FOREGROUND-COLOR or BACKGROUND-COLOR clause
   value must be between 0 and 7 inclusive.
We are looking at options like redefining "colour 7" in Extra!
to be 255,255,255 (pure white) instead of the current 192,192,192
which results in a light grey background.
I'll ask VSI directly also if this restriction can be expanded
https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
but thought I'd just ask if someone have seen this before
and might have some other solution.
Regards,
Jan-Erik.
I have added one additional request to VSI. An option in the
"screen section" that simply disables all colour changing
commands from the compiler. Our default colours in the
terminal emulator are OK and do not need any changes.
screen section.
01  scrPageHeader blank screen no-color-changes.
    02  value "Hello world - Screen section" line 2 column 1.
Or something similar...
So what you're saying is that Cobol knows better than you what the screen
colors should be?
Got to wonder how that survived this long ...
I have no idea how much this feature is used. Not needed if you have
and use FMS, DECforms, TDMS or some other similar form mgm tool.

We use one tool today that was a customer unique tool from DEC Sweden
(the manual has both RSX and VMS sections), but it doesn't support
132 char screens. We do have the Fortran source, but instead of trying
to patch that tool, we look at the "screen section" in Cobol.

It is acually really neat, the only issue right now is the default
colour handling done by the compiler.

On can work around it by not defining a "screen section" and instead
add the row/col options to each DISPLAY statement, but more work
and not as clean in the actual code...
Arne Vajhøj
2021-08-14 17:51:48 UTC
Permalink
Post by Dave Froble
Post by Jan-Erik Söderholm
Post by Jan-Erik Söderholm
When defining screens using the "screen section" in Cobol,
one can add "foreground-color is n" and "background-color is n".
Now, the numeric parameter n has valid values between 0 and 7.
But our terminal emulator (and the ANSI/VT ESC sequence standard)
has 16 settings. In our emulator (Extra!) they are 0-15.
0="black"
7="white"
15="bright white"
%COBOL-F-SCRCOLVAL, FOREGROUND-COLOR or BACKGROUND-COLOR clause
   value must be between 0 and 7 inclusive.
We are looking at options like redefining "colour 7" in Extra!
to be 255,255,255 (pure white) instead of the current 192,192,192
which results in a light grey background.
I'll ask VSI directly also if this restriction can be expanded
https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
but thought I'd just ask if someone have seen this before
and might have some other solution.
I have added one additional request to VSI. An option in the
"screen section" that simply disables all colour changing
commands from the compiler. Our default colours in the
terminal emulator are OK and do not need any changes.
screen section.
01  scrPageHeader blank screen no-color-changes.
    02  value "Hello world - Screen section" line 2 column 1.
Or something similar...
So what you're saying is that Cobol knows better than you what the
screen colors should be?
Got to wonder how that survived this long ...
Just note that this is standardized.

<quote>
9.2.7 Color number
Color is one of the attributes that may be specified for screen items.
For a monochrome terminal, the color
attributes are mapped onto other attributes by the implementor.
A color is selected by specifying the corresponding integer that
represents the color number. The colors given in
the table are a rough guide only; the exact shade of color will depend
on the terminal capabilities. For example the
value 6 might be shown as brown, but when HIGHLIGHT is also selected it
might appear as yellow or the value 0
might be shown as black but when HIGHLIGHT is also selected it might
appear as gray.
black
blue
green
cyan
red
magenta
brown/yellow
white
0
1
2
3
4
5
6
7
</quote>

So it should probably be an build option.

Like:

/COLPASS

Color passthrough.

Arne
Bill Gunshannon
2021-08-14 18:07:18 UTC
Permalink
Post by Arne Vajhøj
Post by Dave Froble
Post by Jan-Erik Söderholm
Post by Jan-Erik Söderholm
When defining screens using the "screen section" in Cobol,
one can add "foreground-color is n" and "background-color is n".
Now, the numeric parameter n has valid values between 0 and 7.
But our terminal emulator (and the ANSI/VT ESC sequence standard)
has 16 settings. In our emulator (Extra!) they are 0-15.
0="black"
7="white"
15="bright white"
%COBOL-F-SCRCOLVAL, FOREGROUND-COLOR or BACKGROUND-COLOR clause
   value must be between 0 and 7 inclusive.
We are looking at options like redefining "colour 7" in Extra!
to be 255,255,255 (pure white) instead of the current 192,192,192
which results in a light grey background.
I'll ask VSI directly also if this restriction can be expanded
https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
but thought I'd just ask if someone have seen this before
and might have some other solution.
I have added one additional request to VSI. An option in the
"screen section" that simply disables all colour changing
commands from the compiler. Our default colours in the
terminal emulator are OK and do not need any changes.
screen section.
01  scrPageHeader blank screen no-color-changes.
    02  value "Hello world - Screen section" line 2 column 1.
Or something similar...
So what you're saying is that Cobol knows better than you what the
screen colors should be?
Got to wonder how that survived this long ...
Just note that this is standardized.
<quote>
9.2.7 Color number
Color is one of the attributes that may be specified for screen items.
For a monochrome terminal, the color
attributes are mapped onto other attributes by the implementor.
A color is selected by specifying the corresponding integer that
represents the color number. The colors given in
the table are a rough guide only; the exact shade of color will depend
on the terminal capabilities. For example the
value 6 might be shown as brown, but when HIGHLIGHT is also selected it
might appear as yellow or the value 0
might be shown as black but when HIGHLIGHT is also selected it might
appear as gray.
black
blue
green
cyan
red
magenta
brown/yellow
white
0
1
2
3
4
5
6
7
</quote>
So it should probably be an build option.
/COLPASS
Color passthrough.
Arne
I haven't looked at the VMS COBOL documentation but with GnuCOBOL
I was surprised that the default was not given and that I saw no
option anywhere to set your own default. A trivial thing, but
still interesting.

bill

Loading...