Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1590

Help: Rainmeter Skins • Re: Conditional Formulas

$
0
0
No, there is NO WAY to use string in mathematical formula, neither in a Formula option of a Calc measure, nor in an IfCondition. Sorry, but I still sustain this. The original question was related to this.
Don't argue anymore, but if you (or anyone else) know a way to use strings in mathematical formula, I'd be (much more then) extremely interested.
Well, your interpretation of the question and solution is a strict one, and in that sense you're right. However, in a broader sense, any variable, formula, conditional or IfCondition is a string itself. See the last paragraphs here, for the preferred argument from authority:
https://docs.rainmeter.net/manual/measures/#Values
https://forum.rainmeter.net/viewtopic.php?t=29313#p152446
And an example to test...

Code:

[Variables]IAmAString1="15>10?3:2"IAmAString2="1+1+1+1+1"IAmAString3="[TestString3]>7"Result=0[Rainmeter]Update=1000AccurateText=1DynamicWindowSize=1---Measures---[TestString1]Measure=CalcFormula="#IAmAString1#"[TestString2]Measure=CalcFormula="#IAmAString2#"[TestString3]Measure=CalcFormula=10IfCondition="#IAmAString3#"IfTrueAction=[!SetVariable Result 2]IfFalseAction=[!SetVariable Result 1]IfConditionMode=1DynamicVariables=1---Meters---[TestMeter]Meter=StringFontSize=12FontColor=255,255,255,255AntiAlias=1MeasureName=TestString1MeasureName2=TestString2Text=Test String 1 = %1#CRLF#Test String 2 = %2#CRLF#Test String 3 = #Result#DynamicVariables=1
Obviously, not every string will work like this, it has to be able to be converted into either a number / formula, or something Rainmeter would "understand". Since the former was not possible in the sl23's question / example, as you mentioned, I chose the latter, since the beauty of it is that you can Substitute any string to a chain of bangs, and you can do any numerical or even string operations in such bangs. In other words, you don't have to directly use "uncovertible" strings into measures, IfConditions or conditionals - you can indirectly Substitute those strings to bangs dealing with the said elements and whatever operations you want without any issues whatsoever. ;-)

Statistics: Posted by Yincognito — Today, 12:07 am



Viewing all articles
Browse latest Browse all 1590

Trending Articles