Difference between revisions of "Textutils.serialize"
From ComputerCraft Wiki
(Created page with "{{lowercase}} {{Function |name=textutils.serialize |args= anything |returns=a string representing the object |api=textutils |addon=ComputerCraft |desc=Convert...") |
|||
| Line 6: | Line 6: | ||
|api=textutils | |api=textutils | ||
|addon=ComputerCraft | |addon=ComputerCraft | ||
| − | |desc=Converts the object to a string that can be saved or sent and then converted back into a copy of the object later, using [[textutils.unserialize()|unserialize]]. Nested structures are supported, but tables with circular graphs will be detected | + | |desc=Converts the object to a string that can be saved or sent and then converted back into a copy of the object later, using [[textutils.unserialize()|unserialize]]. Nested structures are supported, but tables with circular graphs will be detected and raise an error. |
|examples= | |examples= | ||
{{Example | {{Example | ||
Revision as of 15:55, 4 October 2012
| Converts the object to a string that can be saved or sent and then converted back into a copy of the object later, using unserialize. Nested structures are supported, but tables with circular graphs will be detected and raise an error. | |
| Syntax | textutils.serialize(anything) |
| Returns | a string representing the object |
| Part of | ComputerCraft |
| API | textutils |
Examples
| Sends a table over rednet | |
| Code |
myThing={name="Test", n=2}
|
| Output | Test |