reading and writing booleans

Has anyone had any experience writing and reading booleans from a file?
I seem to get inconsistent results using the following code:

local value1 = true

file:write( tostring( var value1) )

value1 = file:read()

I print out value1 and it seems to be correct but when I attempt to test it or use it, it does not not seem to work properly.
For example:

if value1 == true then

end

views:1258 update:2012/1/1 13:29:50
corona forums © 2003-2011