Advertisement
ecco7777

CC fileToTable() Function

Mar 20th, 2016
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.28 KB | None | 0 0
  1. function fileToTable(file)
  2. if fs.exists(file)~=true then
  3. print("file"..file.." not found")
  4. return(false)
  5. end
  6. fp=fs.open(file,"r")
  7. line={}
  8. i=1
  9. line[i]=fp.readLine()
  10. if line[i]==nil then return(false) end
  11. while line[i]~=nil do
  12. i=i+1
  13. line[i]=fp.readLine()
  14. end
  15. return(line)
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement