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

Lua Scripting • Re: Lua for conditional operators with strings as result. [Help]

$
0
0
I think that simply SKIN:ParseFormula(cond) would work, assuming that cond is already a round bracket enclosed argument on the Rainmeter side
Yeah though I mentioned this only as an alternative if not enclosing the formula in the standard parentheses on the INI side, as that's what Ricardo's OP example was originally trying to achieve afaict (as in their second post in the thread they apparently wanted it to be displayed also as a text string sans the parentheses).
By the way, like SilverAzide alluded to, since conditionals in Rainmeter are strictly numerical and result in a number, one can skip enclosing the conditionals between apostrophes, thanks to this nice addition courtesy of Brian
That's a good method, too. IMO the ParseFormula approach is flexible as it accepts any such input including with spaces, while using strings for the argument is also useful if you want to expand the function to also handle purely string-based comparisons (rather than just numerical formulas), which is something I touched on and make use of.
Not entirely sure why it works for other options though, maybe it has to do with the fact that those can take a "0" part in them without issues
Mmm, seems plausible. I'm glad it's brought some discussion at least. Still would be nice to suppress :D

Statistics: Posted by Crest — Yesterday, 9:03 pm



Viewing all articles
Browse latest Browse all 1407

Trending Articles