In regards to your original question, I can't see a reason why it wouldn't work unless your string value of the score had a leading non numeric character in it similar to what you are saying about the square above. If when your player was typing in name$, it is likely the carriage return was tagged onto the end of that as well. When you save the strings to the file, everything looks okay when you view the file. But, when it is read back, that extra carriage return is read in and throws off the strings read back.
fname$="test_name_string.data"
if file exist(fname$) then delete file fname$
open to write 1,fname$
rem create name$ with an added carriage return on the end
name$="monkey"+chr$(13)
hscore$="5"
write string 1,name$
write string 1,hscore$
close file 1
stringcount=0
open to read 1,fname$
while file end(1) ! 1
inc stringcount
read string 1,a$
if a$ < chr$(32)
print "an ascii code detected = ";asc(a$)
endif
print a$
endwhile
close file 1
print "2 strings were saved and ";stringcount;" strings were read back"
What this code demonstrates is an extra carriage return (chr$(13)) added onto the end of monkey is saved in the file. When this is read back as a string, first 'monkey' gets read in and assigned to
a$, then the rogue chr$(13) is read back but it isn't converted to a string in DB it ends up as NULL 0 . Then 5 is read back, then the end of the file as NULL . So, in your original code, I'm guessing there was an extra non printable character at the end of name$ that was causing behavior as described above.
As a test, using your original code read back all of the strings in the file and print them using a loop. I've included a while loop as an example:
if file exist("score.dat")=0
`make the default score file
open to write 1,"score.dat"
write string 1,"None"
write string 1,"0"
close file 1
endif
`Open the score.dat file and store its contents in variables
open to read 1,"score.dat"
while file end(1) ! 1
read string a$
print string a$
endwhile
close file 1
In theory, you should see your hscore$ of 73 print out.
Enjoy your day.