223 posts
Location
Minecraft in Minecraft in Minecraft in ComputerCraft... in Minecraft
Posted 14 November 2014 - 05:18 PM
I have a table in a different file that shows like this:
{
"Testing Tables",
}
How do I convert it into a string?
1080 posts
Location
In the Matrix
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 on 14 November 2014 - 04:22 PM
223 posts
Location
Minecraft in Minecraft in Minecraft in ComputerCraft... in Minecraft
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?
Edited on 14 November 2014 - 04:26 PM
3057 posts
Location
United States of America
Posted 14 November 2014 - 06:18 PM
Add this in after
if type( tbl ) ~= "table" then
error( "Your custom error message", 0 )
end
223 posts
Location
Minecraft in Minecraft in Minecraft in ComputerCraft... in Minecraft
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)