Guest User

test

a guest
Mar 9th, 2013
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.62 KB | None | 0 0
  1. local tTable = {
  2.   [1] = {"pbin code", "progName" },
  3.   [2] = {"another pbin code", "another progName"},
  4. }
  5.  
  6. function writeTo( prog )
  7.   local file = fs.open( prog, "w" )
  8.   file.write( textutils.serialize( tTable ) )
  9.   file.close()
  10. end
  11.  
  12. function readIt( prog )
  13.   local file = fs.open( prog, "r" )
  14.   local handler = file.readAll()
  15.   file.close()
  16.  
  17.   return textutils.unserialize( handler )
  18. end
  19.  
  20. writeTo( "x" )
  21. local parm = readIt( "x" )
  22. print(parm[2][1])
  23.  
  24. --tTable[#tTable + 1] = {} I know this wont work
  25. table.insert(tTable[3], "another another pbin code")
  26. print(tTable[3][1])
  27. --I need to create a table somehow
Advertisement
Add Comment
Please, Sign In to add comment