I have a table in a different file that shows like this:
{
"Testing Tables",
}
How do I convert it into a string?
Table > String
Started by LewisTehMinerz, Nov 14 2014 05:18 PM
4 replies to this topic
#1
Posted 14 November 2014 - 05:18 PM
#2
Posted 14 November 2014 - 05:20 PM
local tableString = textutils.serialize(tbl)Turns tbl into a string
local tbl = textutils.unserialize(tableString)back into a table.
Edited by Dragon53535, 14 November 2014 - 05:22 PM.
#3
Posted 14 November 2014 - 05:25 PM
Cheers!
I asked this because I'm making a package manager for my OS (in testing) that when it gets a defined argument (-pkg) it will load up the .pkg file (aka a table with all the links in it so the manager can download the correct files) and install the program
EDIT: How can I make it so if it fails to load it because it's not a table, it prints an error?
EDIT: How can I make it so if it fails to load it because it's not a table, it prints an error?
Edited by lewislovesgames, 14 November 2014 - 05:26 PM.
#4
Posted 14 November 2014 - 06:18 PM
Add this in after
if type( tbl ) ~= "table" then error( "Your custom error message", 0 ) end
#5
Posted 18 November 2014 - 04:07 PM
@Dragon53535 & @KingofGamesYami would you like to join the FrostOS team? The package manager is part of this OS and you can join the community if you want. Get Github if you want to join. I'd be so happy if you'd join!
(Also, I'll put you into the Owners)
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











