I've read few posts about load/save data, but I don't want to use any libraries. I have a .txt file with only 1 number and I am using filesystem to get that number for using in a table.
file= love.filesystem.exists("1.txt")
if not file == true then
print("made 1.txt")
data = love.filesystem.newFile("1.txt")
data :open('w')
data :write(1)
data :close()
end
data = love.filesystem.newFile("1.txt")
number = data :read()
print(number) -- that works and prints '1' in console
print(modes[number].width) -- that thing does not work, altho if you replace number with just a number '1' - it does work and prints other values from other table
is there a way to solve this somehow?
Last edited by bramblez on Tue Jun 04, 2013 5:34 pm, edited 1 time in total.
data = love.filesystem.newFile("1.txt")
number = data :open('r') --also tried open('w')
print(number) -- that works and prints '1' in console
print(modes[number].width) -- does not work
but no luck. Is there a way to get a value from this file not as a string?