It is currently April 26th, 2024, 6:17 am

Unable to set a variable. 25 lines of code ...

Get help with creating, editing & fixing problems with skins
ronzino
Posts: 22
Joined: June 4th, 2020, 4:41 pm

Unable to set a variable. 25 lines of code ...

Post by ronzino »

Hello guys, I am facing a stupid problem, but sorry I cannot figure out how to solve. O.O
In the debugger, "a" is always equal to 0. I expect that it will suddenly become = 1 immediatly

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Variables]
a=0

[MyMeas]
Measure=Calc
DynamicVariables=1
Formula=5
IfAboveValue=5
IfAboveAction=[!SetVariable a "1"]

[MyMeter]
Meter=String
DynamicVariables=1
X=0
Y=0
FontColor=255,255,255,255
FontFace=Segoe UI
FontSize=20
AntiAlias=1
Text=HELLO
Also this does not work

Code: Select all

[MyMeas]
Measure=Calc
DynamicVariables=1
Formula=5
[!SetVariable a "1"]
User avatar
jsmorley
Developer
Posts: 22630
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Unable to set a variable. 25 lines of code ...

Post by jsmorley »

ronzino wrote: June 4th, 2020, 4:48 pm Hello guys, I am facing a stupid problem, but sorry I cannot figure out how to solve. O.O
In the debugger, "a" is always equal to 0. I expect that it will suddenly become = 1 immediatly

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Variables]
a=0

[MyMeas]
Measure=Calc
DynamicVariables=1
Formula=5
IfAboveValue=5
IfAboveAction=[!SetVariable a "1"]

[MyMeter]
Meter=String
DynamicVariables=1
X=0
Y=0
FontColor=255,255,255,255
FontFace=Segoe UI
FontSize=20
AntiAlias=1
Text=HELLO
Also this does not work

Code: Select all

[MyMeas]
Measure=Calc
DynamicVariables=1
Formula=5
[!SetVariable a "1"]
In the first example, the value of [MyMeas] is not above 5 is it?

The second example is not a valid option for Rainmeter. Bangs must be executed by an "action" option. The first example is fine, other than the fact that 5 is not above 5. It's above 4, and it's below 6 and it's equal to 5, but it's not above 5.
ronzino
Posts: 22
Joined: June 4th, 2020, 4:41 pm

Re: Unable to set a variable. 25 lines of code ...

Post by ronzino »

mmm I thought "above" means "before" i.e. written on line above this. but ok, it was a desperate attempt to do a little more complicated thing.
Now I have better understood that a positive condition is mandatory to execute a bang

And another piece of come of mine started to work....even if i don't know if it is so elegant.
Do you have suggestions ?

Code: Select all


[MeasArmNextState]
Measure=calc
DynamicVariables=1
Formula=#ArmNextState#
IfConditionMode=1 
IfCondition= 1 = 1
IfTrueAction=[!SetVariable ArmPresentState "#ArmNextState#"]


Thanks for your help