Inno Setup define a hexidecimal color constant -


i trying use [ispp] section define hexidecimal color later used in [code] section spot color, value of may change in future, getting type mismatch error when running. here relevant sections code:

[ispp] #define colorpetrol "$c8c264"  [code] procedure initializewizard(); var   portlabel: tnewstatictext; begin   portlabel := tnewstatictext.create(wizardform);   portlabel.caption := 'port';   portlabel.top := scaley(78);   portlabel.parent := page.surface;   portlabel.font.color := expandconstant('{#colorpetrol}'); end; 

i assuming error caused define constant being string , portlabel.font.color requiring hex value. how can constant defined in [ispp] section , used in way correctly?

just use portlabel.font.color := {#colorpetrol};. expandconstant() expanding built-in inno setup constants, not ispp defines. latter textual replacements.

as side note, i'm not aware of [ispp] section. imo should move define [code] section.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -