It is currently September 19th, 2024, 1:20 am
Nested Conditions + Formulas
-
- Rainmeter Sage
- Posts: 8171
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
-
- Rainmeter Sage
- Posts: 16552
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Nested Conditions + Formulas
The second occurrence of the X option is in vain. As usually, Rainmeter ignores it.sl23 wrote: ↑July 19th, 2024, 3:50 pmCode: Select all
[sBar] Shape=Rectangle 0, 0, #BarW#, -#BarH# | StrokeWidth 0 | Fill Color #Bg# Shape2=Rectangle 0, ([#CURRENTSECTION#Total]<1 ? 0.00001 : (([#CURRENTSECTION#Used:]/([#CURRENTSECTION#Total:]+0.000001)*#BarH#))), #BarW#, 2 | StrokeWidth 0 | Fill Color [#C[#CURRENTSECTION]] DynamicVariables=1 Hidden=([#CURRENTSECTION#Total:]=0 ? 1 : 0) X=([#CURRENTSECTION#Used:]=0 ? 0 : 2)R Y=#BarH# ;X=([mFUsed:]/([mFTotal:]+0.00001)*150+15) X=([mFTotal]<1 ? 0.00001 : (([#CURRENTSECTION#Used:]/([#CURRENTSECTION#Total:]+0.000001)*-#BarH#))) [m1] Meter=Shape MeterStyle=sBar X=0
In this one? Sorry, I took over the Formula from your post.
You're welcome from my part.
You are not comfortable? Rainmeter isn't! The parenthesis are absolutely needed, otherwise the formula doesn't work.Yincognito wrote: ↑July 19th, 2024, 3:51 pm Personally, I would write *(-#BarH#) instead. I'm not comfortable with two operations following immediately after one another, without some operation member between them.
-
- Posts: 1700
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Nested Conditions + Formulas
Thanks balala, I understand about several X lines of code. Just testing trying to get it working. Been trying all day!
57686174 77696C6C 6265 77696C6C 6265
-
- Rainmeter Sage
- Posts: 16552
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Nested Conditions + Formulas
Good. We all do such things from time to time (me at least definitely do).
-
- Rainmeter Sage
- Posts: 8171
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Nested Conditions + Formulas
Well, I was trying to be gentle there. Too many mistakes for me to be straightforward about it, so I chose to be diplomatic instead.
-
- Rainmeter Sage
- Posts: 16552
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
-
- Posts: 1700
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Nested Conditions + Formulas
...Thought it best to resurrect this thread as I have another issue with this but different skin.
Although I've used [#C[#CURRENTSECTION]] Variable successfully, I seem unable to get it working the other way: [#[#CURRENTSECTION]CPU]. This won't work and I have no idea how to make it work. Could you help please
Current Section = m1
Variable = m1CPU
I realised it should be like this: [#CURRENTSECTION[#CPU]], but that won't work either.
I've tried around 30 variations and nothing works. Why isn't this documented better! I keep having issues with it because there's very little info about how Nested Variables work. Sorry for my frustration.
Although I've used [#C[#CURRENTSECTION]] Variable successfully, I seem unable to get it working the other way: [#[#CURRENTSECTION]CPU]. This won't work and I have no idea how to make it work. Could you help please
Current Section = m1
Variable = m1CPU
I realised it should be like this: [#CURRENTSECTION[#CPU]], but that won't work either.
I've tried around 30 variations and nothing works. Why isn't this documented better! I keep having issues with it because there's very little info about how Nested Variables work. Sorry for my frustration.
57686174 77696C6C 6265 77696C6C 6265
-
- Rainmeter Sage
- Posts: 16552
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Nested Conditions + Formulas
Extremely hard to say anything meaningful, because have no idea how your code looks like. On a first and extremely simple approach this is working for me, but there might be lot of details, which could make a difference. Check to have added a DynamicVariables=1 option to the not-working measure / meter and if still doesn't work, post a sample code please.
-
- Posts: 1700
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: Nested Conditions + Formulas
Thanks balala, I ended up rewording the measures and variables to work the way I know works.
I just couldn't figure out what was doing wrong. Thanks anyway for your response
I'll be back...
I just couldn't figure out what was doing wrong. Thanks anyway for your response
I'll be back...
57686174 77696C6C 6265 77696C6C 6265
-
- Rainmeter Sage
- Posts: 16552
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Nested Conditions + Formulas
As you want...