It is currently September 8th, 2024, 12:11 am

Nested Conditions + Formulas

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 8030
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Nested Conditions + Formulas

Post by Yincognito »

sl23 wrote: July 21st, 2024, 9:16 pm There is another question...
Why do you need to use this:
[#[#CURRENTSECTION]]

Here's a meter as an example:
[...]
It's you who needs to use this, and that's based on the particularities of your code. In [#[#CURRENTSECTION]], [#CURRENTSECTION] will resolve to the literal 1Stat string, so the whole construct becomes [#1Stat], i.e. the equivalent of #1Stat# aka the value of the 1Stat variable. Unlike a measure, a meter doesn't have a value, so you probably intentionally used a variable with the same name as the meter to compensate for that.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1600
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Nested Conditions + Formulas

Post by sl23 »

Ok, now I'm wondering why DynamicVariables was needed for Variable2 but not Variable1?
57686174 77696C6C 6265 77696C6C 6265
User avatar
sl23
Posts: 1600
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Nested Conditions + Formulas

Post by sl23 »

Yincognito wrote: July 21st, 2024, 9:25 pm It's you who needs to use this, and that's based on the particularities of your code. In [#[#CURRENTSECTION]], [#CURRENTSECTION] will resolve to the literal 1Stat string, so the whole construct becomes [#1Stat], i.e. the equivalent of #1Stat# aka the value of the 1Stat variable. Unlike a measure, a meter doesn't have a value, so you probably intentionally used a variable with the same name as the meter to compensate for that.
So I was right? :)
57686174 77696C6C 6265 77696C6C 6265
User avatar
Yincognito
Rainmeter Sage
Posts: 8030
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Nested Conditions + Formulas

Post by Yincognito »

sl23 wrote: July 21st, 2024, 9:22 pm I didn't look, honestly, is it:
[#Variable[&Measure1:]] or [#Variable[&Measure[#Num]:]]
Nice attempt. For the record, there's no need to use [SomeMeasure:] or [&SomeMeasure:] if your SomeMeasure doesn't have a different number value compared to its string value. The only reason for the : is to force the usage of that measure's number value, but since in balala's code the measure is a Calc without a Substitute that could change its string value, the : is not absolutely needed.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16499
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Nested Conditions + Formulas

Post by balala »

sl23 wrote: July 21st, 2024, 9:25 pm Haha, no worries balala, it is an excellent example and I've added your post to it and will keep it as a reference! :thumbup:
I'm glad. Wish you all the best with these nesting variables.
User avatar
sl23
Posts: 1600
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Nested Conditions + Formulas

Post by sl23 »

Ah ok, I see, you've just taught me something else too! :thumbup:
And the fact you can use a substitute and use : to still get the number value, brilliant, I was trying to do that the other day, didn't know how!

Thanks for everything, and your patience! :thumbup: :oops:
57686174 77696C6C 6265 77696C6C 6265
User avatar
sl23
Posts: 1600
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Nested Conditions + Formulas

Post by sl23 »

balala wrote: July 21st, 2024, 9:32 pm I'm glad. Wish you all the best with these nesting variables.
Thanks very much for your help, you've been a great help :thumbup:
57686174 77696C6C 6265 77696C6C 6265
User avatar
balala
Rainmeter Sage
Posts: 16499
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Nested Conditions + Formulas

Post by balala »

sl23 wrote: July 21st, 2024, 9:26 pm Ok, now I'm wondering why DynamicVariables was needed for Variable2 but not Variable1?
No, it was not needed for Variable2, but for [&Measure1], I think. This is why [#Variable[#Num]] has been resolved properly, while neither [#Variable[&Measure1]] nor [#Variable[&Measure[#Num]]] have been.
User avatar
Yincognito
Rainmeter Sage
Posts: 8030
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Nested Conditions + Formulas

Post by Yincognito »

sl23 wrote: July 21st, 2024, 9:16 pmI think I get it actually. The [#CURRENTSECTION] gets the Section name and the [# ] Makes it get the Variable with that name, is that right?
sl23 wrote: July 21st, 2024, 9:28 pm So I was right? :)
Yep, you were. I probably posted the reply before your edit, or without checking for updates on that post. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
sl23
Posts: 1600
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Nested Conditions + Formulas

Post by sl23 »

IT WORKED!!!! :D :D :D
That's solved a lot of problems! :thumbup:
57686174 77696C6C 6265 77696C6C 6265