<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>TableRemove return value</title>
        <description> Quotetable.remove (table [, pos])

Removes from table the element at position pos, shifting down other elements to close the space, if necessary. Returns the value of the removed element. The default value for pos is n, where n is the length of the table, so that a call table.remove(t) removes the last element of table t.

For some reason TableRemove seems to return nil instead of the removed value.</description>
        <link>/forum/read.php?5,15441,15441#msg-15441</link>
        <lastBuildDate>Sat, 12 Sep 2026 14:08:34 +0000</lastBuildDate>
        <generator>Phorum 5.2.23</generator>
        <item>
            <guid>/forum/read.php?5,15441,15475#msg-15475</guid>
            <title>Re: TableRemove return value</title>
            <link>/forum/read.php?5,15441,15475#msg-15475</link>
            <description><![CDATA[ Very interesting, now it works :)<br />
<br />
Earlier I had to write <br />
<pre class="bbcode">
local item = queue[#queue]
TableRemove(queue)</pre>
to avoid some nil reference error instead of<br />
<pre class="bbcode">
local item = TableRemove(queue)</pre>
But now it works with a single line as it should. And this happened twice with different code ::o <br />
Maybe my change did not fix anything and the error was somewhere else.]]></description>
            <dc:creator>arisoft</dc:creator>
            <category>Method requests</category>
            <pubDate>Wed, 10 Jan 2018 16:34:04 +0000</pubDate>
        </item>
        <item>
            <guid>/forum/read.php?5,15441,15473#msg-15473</guid>
            <title>Re: TableRemove return value</title>
            <link>/forum/read.php?5,15441,15473#msg-15473</link>
            <description><![CDATA[ I wonder if this could be a bug in LUA or something that has changed over the versions. The Sandbox doesn&#039;t control what it returns, there is only an associative list of functions that should be included/allowed. Like:<br />
			TableMaxn = table.maxn,<br />
			TableRemove = table.remove,<br />
			TableSort = table.sort,<br />
<br />
The LUA version that is currently being used is 5.1.5.<br />
<br />
Since I am not used to LUA at all anymore, if I ever was. If you write a short LUA snippet that I can test in CLI I can run it directly on the server. Something like:<br />
Add to table<br />
Add to table<br />
Add to table<br />
removed = Remove from table<br />
print(removed)]]></description>
            <dc:creator>magma1447</dc:creator>
            <category>Method requests</category>
            <pubDate>Wed, 10 Jan 2018 16:06:47 +0000</pubDate>
        </item>
        <item>
            <guid>/forum/read.php?5,15441,15441#msg-15441</guid>
            <title>TableRemove return value</title>
            <link>/forum/read.php?5,15441,15441#msg-15441</link>
            <description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />table.remove (table [, pos])<br />
<br />
Removes from table the element at position pos, shifting down other elements to close the space, if necessary. <span style="color:#FF0000">Returns the value of the removed element.</span> The default value for pos is n, where n is the length of the table, so that a call table.remove(t) removes the last element of table t.</div></blockquote>
<br />
For some reason TableRemove seems to return nil instead of the removed value.]]></description>
            <dc:creator>arisoft</dc:creator>
            <category>Method requests</category>
            <pubDate>Wed, 10 Jan 2018 09:48:56 +0000</pubDate>
        </item>
    </channel>
</rss>
