Beta: Runtime Exception line # diff.

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
In the code below, line 37 is using Test2 as a boolean while line 42 does not identify the Sub Test2(b as Int) As Boolean.

Run this without the Debugger and both the Logs tab and the device will show an error at line 44: "Cannot parse as boolean".

With the Debugger, they both show the error at line 33 and Debugger stops and highlights that line, even though that line is not where the error is.

B4X:
26 Sub Test1
27        Log("Test1")
 
28 
29        a = 1
30        b = 2
31        c = 3
 
32
33        If a = 2 Then
34                 a = 1
35       Else If b = 3 Then
36                 b = 2
37       Else If Test2(b) AND a = 1 Then
38                 c = 1
39       End If
40 End Sub
41
42 Sub Test2(b As Int)
43       Log("Test2")
44 End Sub
 
Top