It is currently March 28th, 2024, 8:24 pm

[Suggestions & Bug] [Variables] and misc variables

Report bugs with the Rainmeter application and suggest features.
oZone
Posts: 154
Joined: May 14th, 2018, 4:46 pm

[Suggestions & Bug] [Variables] and misc variables

Post by oZone »

It would be great if #CURRENTSECTION# variable is not resolved in [Variables] section.

Using #CRLF# in [Variables] section can cause issue with inplace tooltip in log in skin tab.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Suggestions & Bug] [Variables] and misc variables

Post by jsmorley »

oZone wrote: December 7th, 2019, 5:28 pm It would be great if #CURRENTSECTION# variable is not resolved in [Variables] section.

Code: Select all

[Variables]
myVar=#*CURRENTSECTION*#
Edit: No, this doesn't really address your issue.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Suggestions & Bug] [Variables] and misc variables

Post by jsmorley »

I think it is better to do it this way...

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]

[Style]
Text=#CURRENTSECTION#

[MeterOne]
Meter=String
MeterStyle=Style
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1

[MeterTwo]
Meter=String
MeterStyle=Style
Y=2R
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1

1.png


When used in a MeterStyle, #CURRENTSECTION# will resolve to the section name the style is used in.
You do not have the required permissions to view the files attached to this post.
oZone
Posts: 154
Joined: May 14th, 2018, 4:46 pm

Re: [Suggestions & Bug] [Variables] and misc variables

Post by oZone »

jsmorley wrote: December 7th, 2019, 5:31 pm

Code: Select all

[Variables]
myVar=#*CURRENTSECTION*#
Maybe I am using it wrong but if I use #myVar# in other section, #CURRENTSECTION# won't be resolved.

Code: Select all

[Variables]
myVar=#*CURRENTSECTION*#

[TextMeter]
Meter=String
Text=#myVar#
;This will show #CURRENTSECTION#, but I want "TextMeter"
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Suggestions & Bug] [Variables] and misc variables

Post by jsmorley »

oZone wrote: December 7th, 2019, 5:38 pm Maybe I am using it wrong but if I use #myVar# in other section, #CURRENTSECTION# won't be resolved.

Code: Select all

[Variables]
myVar=#*CURRENTSECTION*#

[TextMeter]
Meter=String
Text=#myVar#
;This will show #CURRENTSECTION#, but I want "TextMeter"
Yeah, I was initially wrong about that. I had edited my post after you saw it... Sorry.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Suggestions & Bug] [Variables] and misc variables

Post by jsmorley »

I think changing the behavior of #CURRENTSECTION# in [Variables] has backwards compatibility risks that we would not be happy with.
oZone
Posts: 154
Joined: May 14th, 2018, 4:46 pm

Re: [Suggestions & Bug] [Variables] and misc variables

Post by oZone »

Great thanks for this workaround.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Suggestions & Bug] [Variables] and misc variables

Post by balala »

jsmorley wrote: December 7th, 2019, 5:41 pm I think changing the behavior of #CURRENTSECTION# in [Variables] has backwards compatibility risks that we would not be happy with.
Definitely. Although it might be good, unfortunately can't be done I think, because of the backwards compatibility.
User avatar
Yamajac
Posts: 134
Joined: June 30th, 2014, 8:44 am

Re: [Suggestions & Bug] [Variables] and misc variables

Post by Yamajac »

This is actually an intended feature, not a bug. And a solution to the problem has already been implemented for a few years.


When you use MyVar = #*CurrentSection*# and then #MyVar#, it resolves to #CurrentSection# literally because the variables can't resolve recursively without using nested variables syntax.


Instead, you would use;

Code: Select all

[Variables]
MyVar = [#*CURRENTSECTION*]

[tester]
measure = string
string = [#MyVar]
This will resolve to tester because we're using nested variables instead of variables that don't support nesting.
oZone
Posts: 154
Joined: May 14th, 2018, 4:46 pm

Re: [Suggestions & Bug] [Variables] and misc variables

Post by oZone »

Thanks for other solution

For bug I mean this
oZone wrote: December 7th, 2019, 5:28 pm Using #CRLF# in [Variables] section can cause issue with inplace tooltip in log in skin tab.