Not defined parameters works

 

Hi guys,

in my code I have this:


I am in debug mode.

As you can see, even if DarkBlue is not defined, it works giving the right value to colour.
Am I missing something?

Thanks

 
Marco Montemari:

Hi guys,

in my code I have this:


I am in debug mode.

As you can see, even if DarkBlue is not defined, it works giving the right value to colour.
Am I missing something?

Thanks

Hi !

And with clr prefix ? Like clrDarkBlue, do you have same thing ?

 
remcous:

Hi !

And with clr prefix ? Like clrDarkBlue, do you have same thing ?

Same behaviour but in this case the crlDarkBlue is in red, recognized by the IDE



 
Marco Montemari:

Same behaviour but in this case the crlDarkBlue is in red, recognized by the IDE



Not sure but i think because clrDarkBlue is a constant.
 
clrDarkBlue is a color. Why are you assigning it to an int?
 
William Roeder:
clrDarkBlue is a color. Why are you assigning it to an int?

it was a try. 

To be honest teh first try was with the cast like

color=(int)clrRedDark but it worked anyway also without cast.

In the guide it says :


The color type is intended for storing information about color and occupies 4 bytes in memory. The first byte is ignored, the remaining 3 bytes contain the RGB-components.

Color constants can be represented in three ways: literally, by integers, or by name (for named Web-colors only).


and it is working.
The problem is not about  clrRedDark ( even if I do not know where it is defined), it works with RedDark too

Documentation on MQL5: Constants, Enumerations and Structures / Objects Constants / Web Colors
Documentation on MQL5: Constants, Enumerations and Structures / Objects Constants / Web Colors
  • www.mql5.com
Web Colors - Objects Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Reason: