When using write/read I am starting to prefer IamM's plugins because they appear to be more stable in writing data, but because there is less "F1" help with these plugins I sometimes find them a bit tricky.
I have found a bit of DBpro code written by TDK back in 2006 which reads several pieces of data.
Filename$="Mydata.dat"
If File Exist(Filename$)
Open To Read 1,Filename$
Read String 1,T$: Rem Ignore This Info
Read String 1,T$: MatrixWidth=Val(T$)
Read String 1,T$: MatrixHeight=Val(T$)
Read String 1,T$: TilesX=Val(T$)
Read String 1,T$: TilesZ=Val(T$)
Read String 1,T$: FloatVar#=Val(T$)
Close File 1
Endif
However I have been unsucessful in converting this to use IanM's plugins "open datafile to read" and "string$ = datafile string$"
Can anyone help?
EDIT:
I can get the following code to read 1 piece of data but adding a 2nd string variable doesnt return a value.
open datafile to read 1,"Score\bestlevel1.txt"
bestscore$ = datafile string$(1)
close datafile 1
note: this code uses my variables and is therefore slightly different to the 1st example.
Example of data to read is 3 rows of numbers written by using "WRITE DATAFILE String" e.g
12
2001
87