Skip to content

Commit

Permalink
Tweaked Inline Lua to make it more clear that table indexes may not b…
Browse files Browse the repository at this point in the history
…e directly referenced from Rainmeter.
  • Loading branch information
jsmorley committed Oct 5, 2024
1 parent aa9de85 commit 19bb5c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/manual/lua-scripting/inline-lua.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h2 id="Notes">Inline Lua Notes</h2>

<p>The Lua <code>boolean</code> data type may be passed to the Lua function with <code>true</code> or <code>false</code>, and any <code>return</code> to Rainmeter of a boolean <code>true</code> will be 1 and <code>false</code> will be 0.</p>

</p>Lua tables, <code>myTable[index]</code>, may not be directly used in a parameter to the Lua function, you will need to pass the table name and the index number or string as separate parameters and use them to access the table in Lua. However, the Lua may return a single value from a table with <code>return myTable[index]</code>. The <a href="#TranslateDay">TranslateDay</a> example below demonstrates this.</p>
</p>Lua tables, <code>myTable[index]</code> or <code>myTable.index</code>, may not be directly used in a parameter to the Lua function, or as a reference to a table object set as a variable in Lua. You will need to pass the table name and the index number or string as separate parameters and use them to access the table in Lua. However, the Lua may return a single value from a table with <code>return myTable[index]</code>. The <a href="#TranslateDay">TranslateDay</a> example below demonstrates this.</p>

<p>The Lua <code>nil</code> data type, indicating that a value doesn't exist, may be used in a parameter, but not as a return type to Rainmeter. In some cases, the <code>boolean</code> value of <code>false</code> may be used to indicate NOT, in place of <code>nil</code>.</p>

Expand Down

0 comments on commit 19bb5c2

Please sign in to comment.