Code Hint: Boolean Values (Error: java.lang.RuntimeException:Cannot parse)

dbergusa

Member
Licensed User
Longtime User
Dim arr() As String
Dim bTestData As Boolean
arr = Regex.Split(",","True,False")
bTestData = arr(0)

Error code = java.lang.RuntimeException:Cannot parse: True as boolean
Error code = java.lang.RuntimeException:Cannot parse: False as boolean

resolved by using this instead
arr = Regex.Split(",","true,false")


B4A uses True and False for boolean. However, coding strings to this format will throw an error in java when attempting to assign them to a boolean variable. You must use false and true when using a boolean value returned from a string.

Admins: feel free to move this to another thread if not appropriate here
 
Last edited:
Top