Well the title says it all.
local number \_path = system.pathForFile( "number.txt", system.ResourceDirectory ) \_file = io.open( \_path, "r" ) for line in \_file:lines() do number = tonumber (line) end io.close( \_file ) \_file = nil \_path = nil \_path = system.pathForFile( "number.txt", system.DocumentsDirectory ) \_file = io.open( \_path, "r" ) if not (\_file) then \_path = system.pathForFile( "number.txt", system.DocumentsDirectory ) \_file = io.open( \_path, "w" ) \_file:write( number ) end io.close( \_file ) \_file = nil \_path = nil
What i do know is this loads up the number.txt to be able to read and write to it?
Thanks!
–SonicX278