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

Bugs & Feature Suggestions • Retrieving table elements using inline Lua

$
0
0
This is probably not a bug, maybe an omission or a mismatch between what the manual says and what's available in practice...

The manual:
Inline Lua can also be used to simply retrieve the current value of any variable that that you may set in the Lua, either in Update() or in a Function() that you call with !CommandMeasure or other inline Lua.
In practice:

Code:

function Initialize()  t, v = {7}, 5end

Code:

[Rainmeter]Update=1000AccurateText=1DynamicWindowSize=1BackgroundMode=2SolidColor=47,47,47,255---Measures---[Script]Measure=ScriptScriptFile=#@#Script.luaUpdateDivider=-1DynamicVariables=1---Meters---[Result]Meter=StringFontColor=255,255,255,255FontFace=ConsolasFontSize=16Padding=5,5,5,5AntiAlias=1Text=Result = [&Script:t[1]]UpdateDivider=-1DynamicVariables=1
So, it looks like one cannot get table elements with inline Lua. I can see a potential reason for that behavior as it could maybe cause some confusion in using the square brackets inside a square bracket enclosed inline Lua, but then Rainmeter parses nested variables just fine in similar cases. To check if the brackets were the issue, I also tried the dot referencing of a table element, aka [&Script:t.1], and it didn't work either.

So, should / will this be possible or not, and if not, should the manual be adjusted to mention this particularity of the inline Lua, or should we always go with the somewhat redundant workaround of using a function to retrieve a table element's value? :???:

Statistics: Posted by Yincognito — Today, 12:30 am — Replies 7 — Views 85



Viewing all articles
Browse latest Browse all 871

Trending Articles