You can't mix and match. Decide what data you're storing and store it. If you write a string and read an int, it's not going to match and vice versa.
If you write a string "4" to a file, you're writing a character not a number, and in this case you're encoding an ascii string.
Proof :
If you want to write a number, writeint and readint.
If you want to write a string, readline and writeline ( or readstring and writestring. )
If you write a string "4" to a file, you're writing a character not a number, and in this case you're encoding an ascii string.
Proof :
Print Asc("4")
If you want to write a number, writeint and readint.
If you want to write a string, readline and writeline ( or readstring and writestring. )