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

Help: Rainmeter Skins • Re: Regular Expressions

$
0
0
I figured in a Calc measure I would need to use a series of IfCondition statements that would cover each range of possible numbers. I thought it would be simpler to use regexp in a substitute command.
Simpler than...?

Code:

[MeasureIndex]Measure=CalcFormula=(Number > 250) ? 5 : ((Number > 139) ? 4 : ((Number > 99) ? 3 : ((Number > 59) ? 2 : 1)))
P.S.: If the Number measure is a WebParser measure, there might be a moment where the measure returns an empty string, which will cause errors in the log. There some tricks you can do to avoid the errors.

Statistics: Posted by SilverAzide — Yesterday, 10:30 pm



Viewing all articles
Browse latest Browse all 781

Trending Articles