Android Question Breakpoint question


Active Member
Licensed User
Longtime User

This is a strange one.
In a normal debug run to the tablet, i observe an erroneous result.

i know where it could go wrong, so i put a red breakpoint at that place
and debug again. The program stops, i see no error in the variable value,
i continue the program, and, no error is observed. (a "Log()" shows no error either)

Can there be any reason why the program behaves differently whith or
without being halted by a breakpoint. (without modifying the code of course)
Can 3000+ lines of code cause memory probs ?



Licensed User
Longtime User
Upvote 0


Active Member
Licensed User
Longtime User

I could show some code, only it is so straightforward, nothing special at all. And 10 lines out of 3000+ don't mean a lot.
Still, i am testing different things, to see where the effect comes from.
I now have a new candidate.
When i stopped for lunch, i closed down b4a. Came back, and the effect was gone ! (i had noticed this before)

After a few debug runs, the effect came back; putting a breakpoint, makes it go away again, as long as the breakpoint is there.
Possible conclusion:
After some debug runs (i tried the run button AND "F5"), something remains in memory that disturbs normal execution.
Something that gets deleted (flushed) when a breakpoint is inserted.
Is there a method to do successive debug runs, and be sure everything of the previous run is flushed ?
Or insert some command to clear the cache...?

Next test: Switch the tablet on and off between debug runs.
Upvote 0


Active Member
Licensed User
Longtime User
Clearing the tablet's cache manually : does not help
Switching tablet on and off: does not help
Switching b4a on and off: does not help
As soon as i put a breakpoint in, the app reacts as it is designed to.

Edit : I found that when i put in a doEvents +/- where i put the breakpoint,
It seems to produce the right result.
This is just after the app updates some results, maybe this takes too much time?
What does doEvents exacly do?

If x<= yThen
Dim i As Int
lbl2.Text = ""
Dim separat As String
For i = 1 To curr
If i = 1 Then separat = "" Else separat = " : "
Dim l1 As String = sBoard(1,i)
If l1 = "" Then l1 = "0"
Dim l2 As String = sBoard(2,i)
If l2 = "" Then l2 = "0"
lblS2.Text = lblS2.Text & separat & l1 & "/" & l2
End If

Last edited:
Upvote 0