It is currently April 19th, 2024, 6:30 pm

Comparing variables

Get help with creating, editing & fixing problems with skins
tangoethan
Posts: 1
Joined: August 26th, 2017, 3:42 am

Comparing variables

Post by tangoethan »

Hi, currently I've been working on a big project and I ran into a problem, after searching for 2 hours I came here to post my own question.

I am wondering how to compare a variable with another variable. as in :

if #Larry# == #Jeffry# do this.

Also can be read as:

if variable Larry is equal to variable Jeffry then do this

Please reply quickly because I need it for my project.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Comparing variables

Post by mak_kawa »

Method varies depending on the contents of variables, numeric or string.

Following sample code may help, I think.

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=192,192,192,192

[Variables]
NumVar1=0
NumVar2=1
StringVar1="Yes"
StringVar2="No"

[CompareNumVar]
Measure=Calc
Formula=1
IfCondition=#NumVar1#=#NumVar2#
IfTrueAction=[!SetOption ShowNumMatch Text "Match"]
IfFalseAction=[!SetOption ShowNumMatch Text "Not Match"]

[CompareStringVar]
Measure=String
String=#StringVar1#
IfMatch=#StringVar2#
IfMatchAction=[!SetOption ShowStringMatch Text "Match"]
IfNotMatchAction=[!SetOption ShowStringMatch Text "Not Match"]

[ShowNumMatch]
Meter=String
X=5
Y=5
SolidColor=64,64,64,192
W=75
H=20
Text="Match"

[ShowStringMatch]
Meter=String
X=5
Y=30
SolidColor=64,64,64,192
W=75
H=20
Text="Match"