Why does this becomes an endless loop?
B4X:
ErrorLabel(DefaultValues)
HiScoreTable.TableSort("Score DESC")
FileOpen(c1,"Pairs.ini",cWrite)
FileWrite(c1,"ImageSet:"&ImageSet)
FileWrite(c1,"Level:"&Level)
FileWrite(c1,"")
FileWrite(c1,"High-Scores:")
FileWrite(c1,"")
FileWrite(c1,HiScoreTable.Cell("Player",0)&"-"&HiScoreTable.Cell("Score",0))
FileWrite(c1,HiScoreTable.Cell("Player",1)&"-"&HiScoreTable.Cell("Score",1))
FileWrite(c1,HiScoreTable.Cell("Player",2)&"-"&HiScoreTable.Cell("Score",2))
FileWrite(c1,HiScoreTable.Cell("Player",3)&"-"&HiScoreTable.Cell("Score",3))
FileWrite(c1,HiScoreTable.Cell("Player",4)&"-"&HiScoreTable.Cell("Score",4))
FileClose(c1)
DefaultValues:
FileOpen(c1,"Pairs.ini",cWrite)
FileWrite(c1,"ImageSet: Basic.ist")
FileWrite(c1,"Level:Easy")
FileWrite(c1,"")
FileWrite(c1,"High-Scores:")
FileWrite(c1,"")
FileWrite(c1,"Player1-0")
FileWrite(c1,"Player2-0")
FileWrite(c1,"Player3-0")
FileWrite(c1,"Player4-0")
FileWrite(c1,"Player5-0")
FileClose(c1)