Bug? Cast Error not detected in debug mode

Paolo SD

Member
Licensed User
Longtime User
Hello,
I have written a code in which I have to check if it is 0 the result of a query
B4X:
Dim cur As Map = data.Get(0)
if (cur.Get("cnt")==0) Then
  .....
when I use Debug mode the IF code is executed. When I compile in Release mode the if don't work.
I must write the code in this way:
B4X:
Dim cur As Map = data.Get(0)
Dim cnt As Int = cur.Get("cnt")
If (cnt==0) Then
  .....

I realized the error of doing print messages when running.
 

Paolo SD

Member
Licensed User
Longtime User
Do you get any error in release mode (assuming that you can see the logs)?

No. No error is in debug mode that mode release. Simply comparing to fail. I tried to print the contents of cur.Get ("CNT") and is 0, but comparing it with the number 0 as not equal. This is why I thought of a casting error. The strange thing is that in debug mode works.
 
Top