Posted 29 September 2014 - 11:32 PM
I've been trying to create a program that writes a table of strings to a file, but I can't figure out how to make it start a new line.
Here is the code:
Here is the code:
function new(data,page)
f = io.open(page,"w")
for _,line in ipairs(data) do
f:write(line,"\n")
end
f:close(page)
end
Here is the line that calls the code:
new({"Hello World!,"Lua is cool"},"test")
Here is the file:
Hello World!Lua is cool