Mystery work-around
Alright, I'm not sure why, but if the file doesn't exist and it is called to be created on activity_pause then it won't be created for some reason. However, when I added the code to write to the file if it didn't exist in the first place, it seems to have fixed the problem.
Old non-working code:
'Load data file
If File.Exists(File.DirDefaultExternal, "l_data.dat") = True Then
List1 = File.ReadList(File.DirDefaultExternal, "l_data.dat")
MaxNum = List1.Get(0)
MaxFields = List1.Get(1)
Else
MaxNum = 99
MaxFields = 6
End If
Activity_Resume
List1.Clear
List1.Add(MaxNum)
List1.Add(MaxFields)
File.WriteList(File.DirDefaultExternal, "l_data.dat", List1)
New working code:
If File.Exists(File.DirDefaultExternal, "l_data.dat") = True Then
List1 = File.ReadList(File.DirDefaultExternal, "l_data.dat")
MaxNum = List1.Get(0)
MaxFields = List1.Get(1)
Else
MaxNum = 99
MaxFields = 6
List1.Clear
List1.Add(MaxNum)
List1.Add(MaxFields)
File.WriteList(File.DirDefaultExternal, "l_data.dat", List1)
End If
Activity_Resume
List1.Clear
List1.Add(MaxNum)
List1.Add(MaxFields)
File.WriteList(File.DirDefaultExternal, "l_data.dat", List1)
So essentially, by creating the file during the program when it is not found fixed the file from not being created on Activity_Pause.
Great program by the way Erel, many thanks from all of us VisualBasic and 'ol fashioned BASIC addicts for creating a new development platform for us to play on =)