Skip to main content

[archive] Ole Color

  • September 21, 2010
  • 5 replies
  • 1 view

[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...

5 replies

[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...
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.

[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...
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.

[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...
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

[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...
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

[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...
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.