Difference between revisions of "libSaveTableToFile"

(Suggested edit more appropriate for the LÖVE Wiki)
m (Linkification)
Line 1: Line 1:
On the [http://lua-users.org/wiki Lua Users Wiki] are a few solutions for serializing tables. This entry is about the one called [http://lua-users.org/wiki/SaveTableToFile Save table to file].
+
On the [http://lua-users.org/wiki Lua Users Wiki] are a few solutions for serializing [[table]]s. This entry is about the one called [http://lua-users.org/wiki/SaveTableToFile Save table to file].
  
It provides two functions:
+
It provides two [[function]]s:
 
* '''table.save(tbl, filename)''' saves a table to a text file.
 
* '''table.save(tbl, filename)''' saves a table to a text file.
 
* '''table.load(filename)''' generates a table from the output file from <code>table.save()</code>.
 
* '''table.load(filename)''' generates a table from the output file from <code>table.save()</code>.
  
They allow you to easily save and load complex data. It uses Lua syntax for the data files, so it is easy to edit by hand.
+
They allow you to easily save and load complex data. It uses [[Lua]] syntax for the data files, so it is easy to edit by hand.
  
It is licensed under the same license as Lua and available
+
It is licensed under the same [[MIT License|license as Lua]] and available
 
[http://lua-users.org/files/wiki_insecure/users/chill/table.save-0.94.lua here].
 
[http://lua-users.org/files/wiki_insecure/users/chill/table.save-0.94.lua here].
  

Revision as of 09:21, 15 September 2010

On the Lua Users Wiki are a few solutions for serializing tables. This entry is about the one called Save table to file.

It provides two functions:

  • table.save(tbl, filename) saves a table to a text file.
  • table.load(filename) generates a table from the output file from table.save().

They allow you to easily save and load complex data. It uses Lua syntax for the data files, so it is easy to edit by hand.

It is licensed under the same license as Lua and available here.