JackKirk Well-Known Member Licensed User Longtime User Jul 30, 2025 #1 A weird one B4X: Dim Gen_files_to_process As Int = 3 If File.Exists(File.DirInternal, "error_msg.txt") Then 'do stuff' End If If Gen_files_to_process Then 'do more stuff End If I accidentally wrote the above (well there was a lot more but this is the outline). When compiled with Debug it came back wuth java.lang.RuntimeException: Cannot parse: 0 as boolean BUT it was pointing to If File.Exists(File.DirInternal, "error_msg.txt") Then NOT If Gen_files_to_process Then Took me a while to realise what was wrong.
A weird one B4X: Dim Gen_files_to_process As Int = 3 If File.Exists(File.DirInternal, "error_msg.txt") Then 'do stuff' End If If Gen_files_to_process Then 'do more stuff End If I accidentally wrote the above (well there was a lot more but this is the outline). When compiled with Debug it came back wuth java.lang.RuntimeException: Cannot parse: 0 as boolean BUT it was pointing to If File.Exists(File.DirInternal, "error_msg.txt") Then NOT If Gen_files_to_process Then Took me a while to realise what was wrong.
ac9ts Active Member Licensed User Longtime User Jul 30, 2025 #2 Similar but different: https://www.b4x.com/android/forum/threads/boolean-1-or-0-compiles-but-then-crashes.166566/
Similar but different: https://www.b4x.com/android/forum/threads/boolean-1-or-0-compiles-but-then-crashes.166566/