I have modified equates.clw to include a few more COLOR: equates for text and panels (regions) etc.
Is the flow of values from an EQUATE uni-directional? For example:
I created a new equate in equates.clw - COLOR:InfoText EQUATE(0AE5F16H)
I then assign the color of a string property to be COLOR:InfoText
So far so good, the string changes color as expected.
I modify the the color in equates.clw thus - COLOR:InfoText EQUATE(0F9F9F9H)
I close Clarion, start it up and open the app but the string has retained the original color, it no longer has the EQUATE name COLOR:InfoText in the color property, it has 0AE5F16H instead. If I type in COLOR:InfoText it changes to the new color.
I assume then that the color property in the STRING control âlooks upâ the EQUATE to try and match it, otherwise it uses the value it has stored somewhere. Is that correct?
It was my intention to have the color of âinformational textâ EQUATEd to a particular value. If I needed/wanted to change it all I needed to do was change the value of the EQUATE and recompile. This doesnât seem to be the case.
Is that the correct method or have I misunderstood the purpose of an EQUATE?
Well, changing equates.clw isnât a good idea because it will be overwritten with every update of Clarion.
Having a colors.clw file that you can include into any app would be a better option.
I donât know when the equate values are applied, obviously when the equate is used, but I suspect the value will also be applied on a recompile of your app?
An EQUATE is just a label assignment. The value is âsubstitutedâ at compile time and does not use run-time memory.
Instead of altering the shipping equate file, it is recommended practice to create one or several categorized equate files that can be included as needed. For instance, one might have something like ProgramColors, AppIcons, or ClientConstants as equate files.
Thanks PurpleEdge2214 and totalhip.
I understand the perils of modifying a shipped file - I will create a dedicated file and include() it somewhere.
totalhip, you state âAn EQUATE is just a label assignment. The value is âsubstitutedâ at compile time and does not use run-time memory.â This doesnât seem to be happening.
I expected that when I changed the value of the EQUATE that the string control, in this case, would âinheritâ the new value. It doesnât, instead it retains the original value of the EQUATE. This behaviour I did not expect.