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

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

$
0
0
I use SKIN:ParseFormula(SKIN:ReplaceVariables(str)) for this in the Lua side so I can pass INI-based variables and whathaveyou as a string argument as-is.

The above example when first wrapped in the standard formula parentheses works fine then as it's using Rainmeter's formula handling, eg:

Code:

String=[&Script:conditional('((10 + 8)*2 = 18)','Yes','No')]

Code:

if SKIN:ParseFormula(SKIN:ReplaceVariables(cond)) == 1 then    return true_str
You can also use Clamp(), Round(), etc.

(A reason why this is useful is since you reuse the same function for non-formula string equivalence checks, too, by toggling formula parsing—edit: with modifications to the arguments and logic, obviously)

Statistics: Posted by Crest — 56 minutes ago — Replies 5 — Views 148



Viewing all articles
Browse latest Browse all 789

Trending Articles