\n is supposed to make a line break. I have never been able to make this work.
Does this still work in the present incarnation of Corona SDK or is this outdated?
Here’s my code if you need that.
[lua]
–set the path to the documents directory
pathDest = system.pathForFile( “ch13Write”, system.DocumentsDirectory)
– open/create the file
local myFile = io.open (pathDest, “a”)
myFile:write (“Hallelujah! I made a file! \n”)
myFile:flush()
io.close(myFile)
–check that the file was created
myFile = io.open ( pathDest, “r”)
if myFile then
–the file exists, read the data
local contents = myFile:read( “*a”)
local myOutput = “Contents of \n” … pathDest … “\n” … contents
io.close(myFile)
display.newText(myOutput, 50, 50, nil, 16)
end
[/lua]