B4J Question Bug or problem??

Robert Valentino

Well-Known Member
Licensed User
I am using B4j 7.32 and read the following values in from a sqllite database

Hard coded here for example

B4X:
Dim test1    As Long = -63453915550580737
Dim test2   As Long = -63453915550580737
      
Log("test:" &(test1 = test2))
These numbers much as they are the same always fail the comparison test

Even when I try a LongAnd against them they fail to match

B4X:
#Region LandANDTest / LongAND 
Public  Sub LongANDTest(N1 As Long, N2 As Long)  As Boolean

       If LongAND(N1, N2) <> 0 Then Return True
       
       Return False
End Sub

Public  Sub LongAND(N1 As Long, N2 As Long) As Long
           Dim jo As JavaObject = CreateJO
     
           Return jo.RunMethod("andLong", Array(N1, N2))
End Sub

#If JAVA
public long andLong(long n1, long n2)           { return n1 & n2;     }
public long orLong(long n1, long n2)            { return n1 | n2;     }
#End If
I am sure this is sometime simple that I am missing

BobVal
 

Robert Valentino

Well-Known Member
Licensed User
inakigarm - thanks for the link to the post.

That is exactly the problem I am having.
Normally I use B4J for quick and dirty stuff and always run in Debug mode.
Code works perfect in Release mode - so it is just a Debug mode problem (fails every time)

I guess I will have to make sure I run in release mode.
 

Robert Valentino

Well-Known Member
Licensed User
Had done the Clean project (BUT did have breakpoints) removed the breakpoints and all works fine in Debug Mode.

Going to have to remember this.... What was I suppose to remember?
 
Top