It is currently October 22nd, 2021, 7:54 am

Is that a bug or a feature (or even a MUST ???)

Report bugs with the Rainmeter application and suggest features.
User avatar
Youkai1977
Posts: 139
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Is that a bug or a feature (or even a MUST ???)

Post by Youkai1977 »

When writing my skins I noticed several times that the order of things that are listed under [Variables] is decisive for whether something ultimately works or not. This can be really frustrating at times when troubleshooting.

Here is an example (1):

Code: Select all

[Variables]
Alpha1=170
Alpha2=80
Alpha3=230
Color1=0,78,195,
Color2=17,207,255,
Color3=164,164,164,
Color5=68,118,255,
Color8=255,0,0,
Color9=165,0,0,
GColor_1=GradientColor | 90 | #Color1##Alpha3# ; 1.0 | #Color2##Alpha3# ; 0.5
SColor_1=Shadow | 0 | 0 | 2.5 | #Color5##Alpha1#
GColor_2=GradientColor | 270 | #Color3##Alpha3# ; 0.5 | #Color4##Alpha3# ; 1.0
SColor_2=Shadow | 0 | 0 | 2.5 | #Color3##Alpha1#
GColor_3=GradientColor | 90 | #Color7##Alpha2# ; 1.0 | #Color8##Alpha2# ; 0.5
SColor_3=Shadow | 0 | 0 | 2.5 | #Color9##Alpha1#
In example (1), the color or alpha data is transferred to the GColor_1 or SColor_1 variable.

Example (2):

Code: Select all

[Variables]
Alpha1=170
Alpha2=80
Alpha3=230
GColor_1=GradientColor | 90 | #Color1##Alpha3# ; 1.0 | #Color2##Alpha3# ; 0.5
SColor_1=Shadow | 0 | 0 | 2.5 | #Color5##Alpha1#
GColor_2=GradientColor | 270 | #Color3##Alpha3# ; 0.5 | #Color4##Alpha3# ; 1.0
SColor_2=Shadow | 0 | 0 | 2.5 | #Color3##Alpha1#
GColor_3=GradientColor | 90 | #Color7##Alpha2# ; 1.0 | #Color8##Alpha2# ; 0.5
SColor_3=Shadow | 0 | 0 | 2.5 | #Color9##Alpha1#
Color1=0,78,195,
Color2=17,207,255,
Color3=164,164,164,
Color5=68,118,255,
Color8=255,0,0,
Color9=165,0,0,
In this example (2) the variables from Color1, Color2 etc. are not transferred to the variables GColor_1 or SColor_1 and the corresponding meter, which needs these values, goes out according to value / colorless.
It's really annoying when you spend hours looking for the bug (if that's one).

Hence my question .... is this a bug in Rainmeter, a feature, or even a MUST ???
User avatar
Active Colors
Moderator
Posts: 870
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: Is that a bug or a feature (or even a MUST ???)

Post by Active Colors »

Youkai1977 wrote: January 28th, 2021, 7:33 pm When writing my skins I noticed several times that the order of things that are listed under [Variables] is decisive for whether something ultimately works or not. This can be really frustrating at times when troubleshooting.

Here is an example (1):

Code: Select all

[Variables]
Alpha1=170
Alpha2=80
Alpha3=230
Color1=0,78,195,
Color2=17,207,255,
Color3=164,164,164,
Color5=68,118,255,
Color8=255,0,0,
Color9=165,0,0,
GColor_1=GradientColor | 90 | #Color1##Alpha3# ; 1.0 | #Color2##Alpha3# ; 0.5
SColor_1=Shadow | 0 | 0 | 2.5 | #Color5##Alpha1#
GColor_2=GradientColor | 270 | #Color3##Alpha3# ; 0.5 | #Color4##Alpha3# ; 1.0
SColor_2=Shadow | 0 | 0 | 2.5 | #Color3##Alpha1#
GColor_3=GradientColor | 90 | #Color7##Alpha2# ; 1.0 | #Color8##Alpha2# ; 0.5
SColor_3=Shadow | 0 | 0 | 2.5 | #Color9##Alpha1#
In example (1), the color or alpha data is transferred to the GColor_1 or SColor_1 variable.

Example (2):

Code: Select all

[Variables]
Alpha1=170
Alpha2=80
Alpha3=230
GColor_1=GradientColor | 90 | #Color1##Alpha3# ; 1.0 | #Color2##Alpha3# ; 0.5
SColor_1=Shadow | 0 | 0 | 2.5 | #Color5##Alpha1#
GColor_2=GradientColor | 270 | #Color3##Alpha3# ; 0.5 | #Color4##Alpha3# ; 1.0
SColor_2=Shadow | 0 | 0 | 2.5 | #Color3##Alpha1#
GColor_3=GradientColor | 90 | #Color7##Alpha2# ; 1.0 | #Color8##Alpha2# ; 0.5
SColor_3=Shadow | 0 | 0 | 2.5 | #Color9##Alpha1#
Color1=0,78,195,
Color2=17,207,255,
Color3=164,164,164,
Color5=68,118,255,
Color8=255,0,0,
Color9=165,0,0,
In this example (2) the variables from Color1, Color2 etc. are not transferred to the variables GColor_1 or SColor_1 and the corresponding meter, which needs these values, goes out according to value / colorless.
It's really annoying when you spend hours looking for the bug (if that's one).

Hence my question .... is this a bug in Rainmeter, a feature, or even a MUST ???
No it is not a bug. Since you have variables in variables, the load order matters. If you don't declare a value for your variable in a variable before it loads then it is treated like a usual string #Color1#, but if you do declare it before it loads then #Color1# will become the value you have declared before your variable in a variable.
User avatar
Youkai1977
Posts: 139
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: Is that a bug or a feature (or even a MUST ???)

Post by Youkai1977 »

Ok, even if you explained it to me in English, it was still very understandable. Even I understood that immediately * lol * :oops:

In short, not a bug, but logical.

Well, I already said it in another thread, I think I'm doing my doctorate in Chinese. It's easier to understand than some of the Rainmeter syntax.

In any case, thanks again for the simple and understandable explanation :thumbup: