<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.solarstrike.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Table_addon</id>
		<title>Table addon - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://www.solarstrike.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Table_addon"/>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=Table_addon&amp;action=history"/>
		<updated>2026-06-17T16:02:31Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://www.solarstrike.net/wiki/index.php?title=Table_addon&amp;diff=956&amp;oldid=prev</id>
		<title>Elverion: /* table.load */</title>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=Table_addon&amp;diff=956&amp;oldid=prev"/>
				<updated>2011-08-02T01:54:32Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;table.load&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 01:54, 2 August 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l62&quot; &gt;Line 62:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 62:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''table table.load(filename)'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''table table.load(filename)'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Loads a table that was saved using [[table.save]]().&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Loads a table that was saved using [[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Table_addon#table.save|&lt;/ins&gt;table.save]]().&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Example'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Example'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	<entry>
		<id>https://www.solarstrike.net/wiki/index.php?title=Table_addon&amp;diff=955&amp;oldid=prev</id>
		<title>Elverion: Created page with '== table.copy == '''table table.copy(table A)'''  Creates a copy of table 'A' and returns the new instance.  '''Example''' &lt;source lang=&quot;lua&quot;&gt; local tab = {1, 2, 3}; local tab2 =…'</title>
		<link rel="alternate" type="text/html" href="https://www.solarstrike.net/wiki/index.php?title=Table_addon&amp;diff=955&amp;oldid=prev"/>
				<updated>2011-08-02T01:52:08Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;== table.copy == &amp;#039;&amp;#039;&amp;#039;table table.copy(table A)&amp;#039;&amp;#039;&amp;#039;  Creates a copy of table &amp;#039;A&amp;#039; and returns the new instance.  &amp;#039;&amp;#039;&amp;#039;Example&amp;#039;&amp;#039;&amp;#039; &amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt; local tab = {1, 2, 3}; local tab2 =…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== table.copy ==&lt;br /&gt;
'''table table.copy(table A)'''&lt;br /&gt;
&lt;br /&gt;
Creates a copy of table 'A' and returns the new instance.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local tab = {1, 2, 3};&lt;br /&gt;
local tab2 = table.copy(tab);&lt;br /&gt;
-- tab and tab2 are two different tables that contain the same data&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== table.contains ==&lt;br /&gt;
'''bool table.copy(table, value)'''&lt;br /&gt;
&lt;br /&gt;
Returns true if the table has a key-value pair with the given value.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local tab = {1, 2, 3};&lt;br /&gt;
print(&amp;quot;Tab contains 1: &amp;quot;, table.contains(tab, 1));&lt;br /&gt;
-- This should print: Tab contains 1: true&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== table.print ==&lt;br /&gt;
'''bool table.copy(table, depth)'''&lt;br /&gt;
&lt;br /&gt;
Prints out all key-value pairs within the table, including nested tables.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local tab = {&amp;quot;Test1&amp;quot; = &amp;quot;Test1 value&amp;quot;, &amp;quot;Test2&amp;quot; = &amp;quot;Test2 value&amp;quot;, &amp;quot;Test table&amp;quot; = {1, 2, 3}};&lt;br /&gt;
table.print(tab);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== table.save ==&lt;br /&gt;
'''string table.save(table)'''&lt;br /&gt;
'''string table.save(table, bool)'''&lt;br /&gt;
'''bool table.save(table, filename)'''&lt;br /&gt;
&lt;br /&gt;
This function allows you to save a table in a Lua compatible way that can then be loaded again using table.load(). Be aware that userdata types and upvalues will not be saved.&lt;br /&gt;
&lt;br /&gt;
If the second value passed to this function is true, io.tmpfile() will be used, making this ideal for larger data. If the second value is a string representing the wanted filename, this function will save the data to that file and return true or false depending on whether or not it was successful.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local tab = {1, 2, 3};&lt;br /&gt;
local str = table.save(tab); -- str is now a serialized string of tab&lt;br /&gt;
if( table.save(tab, &amp;quot;test.txt&amp;quot;) ) then&lt;br /&gt;
print(&amp;quot;File successfully saved.&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== table.load ==&lt;br /&gt;
'''table table.load(string)'''&lt;br /&gt;
'''table table.load(filename)'''&lt;br /&gt;
&lt;br /&gt;
Loads a table that was saved using [[table.save]]().&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local tab = {1, 2, 3};&lt;br /&gt;
local str = table.save(tab, str);&lt;br /&gt;
local tab2 = table.load(str); -- tab2 should now be a copy of tab.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Elverion</name></author>	</entry>

	</feed>