Skip to content

BUG: SUPERBOL and the AIO compiler version USES WRONG COLORS #531

@eugeniodilo

Description

@eugeniodilo

The following program, compiled in the VSCODE environment with SUPERBOL and the AIO version of the GnuCOBOL compiler, displays incorrect colors.

        >>SOURCE FREE
IDENTIFICATION DIVISION.
PROGRAM-ID. TESTCOLOR8.
DATA DIVISION.
WORKING-STORAGE SECTION.
01  colour-table value '00010203040506070809101112131415'.
    05  wcolours PIC 99 OCCURS 16 TIMES.
01  i            PIC 9(3).
01 wColorTable   pic x(160) value
    'Black     Blue      Green     Cyan      Red       Magenta   Brown     LightGrey ' &
    'DarkGrey  LightBlue LightGreenLightCyan LightRed  Pink      Yellow    White     '.
01 wColorTable2 redefines wColorTable.
    05 wColorDesc occurs 16 pic x(10).
01 wFCOLOR PIC 99.

PROCEDURE DIVISION.
set environment 'COB_LEGACY'            TO '1'     *> activate color codes from 8 to 15
display ' ' at 0101 with blank screen end-display. *> initialize curses
PERFORM VARYING i FROM 1 BY 1 UNTIL i > 16
    if i = 8 or i = 16 compute wFCOLOR = 00 else compute wFCOLOR = 07 end-if 
    DISPLAY FUNCTION CONCAT ('       '  wcolours (i) '   ' WcolorDesc(i) '              ') 
            AT LINE i COLUMN 1 BACKGROUND-COLOR wcolours (i) FOREGROUND-COLOR wFCOLOR
END-PERFORM
ACCEPT omitted
GOBACK.

In particular, it shows how there is no difference between the classic normal colors (codes 00 to 07) and the extended (hilight) colors (codes 08 to 15).
Also as other example the Magenta color in my opinion is wrong.

This behavior is incorrect and should be fixed.

Image

Following image shows correct colors.
Same program compiled with GnuCOBOL 3.2 from Arnold Trembley version.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions