Highlighted
Absent Member.
Absent Member.
504 views

[archive] Ole Color

[Migrated content. Thread originally posted on 17 September 2010]

Hy,
I define
01 OLE_COLOR PIC 9(9) COMP-5.
I want to create a RGB color in unique variable to pass to object but not working, i think cast cut number or define it's wrong..

* 01 OLE-BLUE VALUE X#0000FF.
* 01 OLE-GREEN VALUE X#00FF00.
* 01 OLE-CYAN VALUE X#00FFFF.
* 01 OLE-RED VALUE X#FF0000.
* 01 OLE-MAGENTA VALUE X#FF00FF.
* 01 OLE-YELLOW VALUE X#FFFF00.
* 01 OLE-WHITE VALUE X#FFFFFF.

COMPUTE OLE_COLOR = RT-COLOR-RED + (RT-COLOR-GREEN * 256) +
(RT-COLOR-BLUE * 65536).


thank for help...
0 Likes
4 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Ole Color

I'm not too sure if it will help or not but I have my OLE colors defined with signs like so:

01 OLE_COLOR PIC S9(9) COMP-5.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Ole Color

In the installation of ACUCOBOL-GT, there is a sample folder which contain the source of graphprn.cbl. This program has an example of calculating RGB colors.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Ole Color

YES I found IT and I use the same function R + G *256 + B *65536 but the visible color (forecolor) that I assign to the control, result of compute, is completly different ....

There are broblem with color dimension 8bit 16bit or else?
or I need to use another control (different from textbox) to explatate the color in RGB???

PS:
I use W$PALETTE to discover color in 3 variable by the user
CALL "W$PALETTE" USING WPALETTE-CHOOSE-COLOR
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Ole Color

It is hard to "guess" what may help, when all you say is "not working". If truncation is the issue, try to use the data type PIC X(4) COMP-N instead.

Also, run the program in the debugger and examine the data item in hex using D OLE-COLOR X, then D OLE-COLOR and use Windows calculator to translate the hex value to decimal and see if the two numbers are equal.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.