function Initialize()
print(SKIN:ParseFormula("2+2"))
end
function Update()
end
EDIT: I'm using 4.0.0 r2746 64-bit Rainmeter version.
Remember that formulas in Rainmeter must be enclosed in (parentheses). The only exceptions are the Formula option of a Calc measure, and the test in an IfCondition.
jsmorley wrote:Remember that formulas in Rainmeter must be enclosed in (parentheses). The only exceptions are the Formula option of a Calc measure, and the test in an IfCondition.
!CommandMeasure
The !CommandMeasure bang can be used to execute Lua code in the context of a particular script instance:
!CommandMeasure "MyScriptMeasure" "MyFunction()"
Multiple statements may be separated by semicolons (;). All statements are global.
!CommandMeasure "MyScriptMeasure" "a = b; print(SKIN:ParseFormula('2+2'))"
All statements must be passed as a single parameter in the bang. Because single-quotes (') and double-quotes (") are both valid string containers in Lua, while only double-quotes are recognized in Rainmeter, single quotes are recommended when passing strings with !CommandMeasure.
Concretely: !CommandMeasure "MyScriptMeasure" "a = b; print(SKIN:ParseFormula('2+2'))"
!CommandMeasure
The !CommandMeasure bang can be used to execute Lua code in the context of a particular script instance:
!CommandMeasure "MyScriptMeasure" "MyFunction()"
Multiple statements may be separated by semicolons (;). All statements are global.
!CommandMeasure "MyScriptMeasure" "a = b; print(SKIN:ParseFormula('2+2'))"
All statements must be passed as a single parameter in the bang. Because single-quotes (') and double-quotes (") are both valid string containers in Lua, while only double-quotes are recognized in Rainmeter, single quotes are recommended when passing strings with !CommandMeasure.
Concretely: !CommandMeasure "MyScriptMeasure" "a = b; print(SKIN:ParseFormula('2+2'))"
Yeah, that looks like an error in the documentation. I'll fix that...