The attached Sudoku Solver code compiles in V2.5 B4A with no errors.
The Solver operates correctly until the following sequence of operations.
Select the last Puzzle.
From the Menu select Delete and confirm Deletion.
Close the Solver.
Re-open the Solver and the Java Null Pointer error will appear.
However, the last Puzzle is deleted correctly and the Puzzle file is OK
If an intermediate Puzzle is deleted no Error occurs.
The Delete last puzzle code is as follows.
Each Puzzle takes 200 Bytes of data
cpuz is the current Puzzle number
Dim Ftext, TT as string
Dim cpuz as int
Ftext = File.ReadString(File.DirRootExternal,"Puzzels.txt")
TT = Ftext.SubString2(0,(cpuz - 1)* 200)
File.Delete(File.DirRootExternal,"Puzzels.txt")
File.WriteString(File.DirRootExternal,"Puzzels.txt",TT)
The Puzzle deletion code appears to set up the error condition which causes the
Solver to fail in the second activation.
I would Appreciate any suggestions that could help to fix this problem.
pbmjoe
:sign0085:
The Solver operates correctly until the following sequence of operations.
Select the last Puzzle.
From the Menu select Delete and confirm Deletion.
Close the Solver.
Re-open the Solver and the Java Null Pointer error will appear.
However, the last Puzzle is deleted correctly and the Puzzle file is OK
If an intermediate Puzzle is deleted no Error occurs.
The Delete last puzzle code is as follows.
Each Puzzle takes 200 Bytes of data
cpuz is the current Puzzle number
Dim Ftext, TT as string
Dim cpuz as int
Ftext = File.ReadString(File.DirRootExternal,"Puzzels.txt")
TT = Ftext.SubString2(0,(cpuz - 1)* 200)
File.Delete(File.DirRootExternal,"Puzzels.txt")
File.WriteString(File.DirRootExternal,"Puzzels.txt",TT)
The Puzzle deletion code appears to set up the error condition which causes the
Solver to fail in the second activation.
I would Appreciate any suggestions that could help to fix this problem.
pbmjoe
:sign0085: