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:
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)
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
(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 — Today, 1:57 am — Replies 5 — Views 164