Bug? Comparison IF THEN does not always work in debug mode

emexes

Expert
Licensed User
Is g.INTValue an int variable?
G is a class that contains only constants.
And so, we still don't *know* the type of g.INTValue. Which is why it would be super-helpful to see the actual code involved, eg:
What is the type of G.INTvalue? How is it initialized to its constant value? Please post at least all the lines of the class that contain the text "INTvalue", even if they are obviously correct ;-)
 

Star-Dust

Expert
Licensed User
Longtime User
And so, we still don't *know* the type of g.INTValue. Which is why it would be super-helpful to see the actual code involved, eg:
INTvalues is int type.
However it doesn't matter because even If I = 1 then didn't work, so the problem is not the type of G.INTvalue. I have already answered above all the questions that you ask because I did not reply to you.
 

emexes

Expert
Licensed User
However it doesn't matter because even If I = 1 then didn't work, so the problem is not the type of G.INTvalue.
Agreed, that does shift the probabilities. It is an interesting problem (albeit probably more fun for us than for you, assuming paid work is backing up)
I have already answered above all the questions that you ask because I did not reply to you.
Thanks, I read them all ;-) I was still keen to see the actual code that (intermittently?) experiences the problem, so whatever subtlety that is possibly causing the issue is not lost through retyping/paraphrasing/simplification, and thus enable reproduction of the problem elsewhere. But I too have paid work backing up, so: no worries either way. It'll be good for everyone using B4I to find out what the cause is.
 

Star-Dust

Expert
Licensed User
Longtime User
Unfortunately I am out of office for a week and I cannot send the code
 

Markos

Active Member
Licensed User
Longtime User
That is frustrating to not be able to explore with a seemingly illogical runtime behaviour.

Take my last silly advice and try a fresh iphone to test in debug mode so if the behaviour persists you can look at b4i interface version and libraries and if that is good then look at service packs for the OS.

One question does this behaviour happen with other Apps or just this one.

The rest is up to you to isolate the cause and hence find the solution.
 

Star-Dust

Expert
Licensed User
Longtime User
It also happened with another App but it did it a few times and then the defect disappeared.

The strange thing that does not do it in release mode. Anyway I will do the test with another iphone as soon as possible
 

emexes

Expert
Licensed User
The strange thing that does not do it in release mode.
That comment triggered a memory of being caught out by compiler optimizations that reorder instructions. That can make things seem weird if you are using breakpoints or stepping, or have code that is optimized out, eg an assignment to a variable that is not later used.

Also, For and While loop tests often get moved to the "other end" of the loop.

Viewing the intermediate Objective C code might give a clue too.
 
Top