Android Question AssertEquals way to indicate in b4a

PABLO2013

Well-Known Member
Licensed User
Longtime User
regards
Sorry, could someone tell me what the correct way to indicate in b4a,
in particular "assertEquals?"

thanks

public void testGeometryRepresentation01 () throws Exception {
Db.prepare stmt01 Stmt = ("SELECT name, villages, HEX (geometry) of villages where people> 350,000 for peoples DESC;");
if (stmt01.step ()) {
assertEquals ("Gypsies" stmt01.column_string (0));
assertEquals ("2546804", stmt01.column_string (1));
assertEquals ("040", stmt01.column_string (2));
Else {}
fail ("Query failed");
}
stmt01.close ();
 

PABLO2013

Well-Known Member
Licensed User
Longtime User
Greetings thank you very much for your interest.
I found some examples for querying through SpatiaLite but are in java, and looking at how to write this in b4a. I understand part of the consultation in SpatiaLite, but do not understand the comparison "assertEquals", you're right is a comparison of strings, but exists in b4a something to compare with "AassertEquals", which would you way to do this, I'm new and clear things not they are when one begins.
tks
pablo
 
Upvote 0

Xandoca

Active Member
Licensed User
Longtime User
You're welcome.
I'm also new member. I don't know AassertEquals but you can use str1 = str2 to test strings like code below:
B4X:
    Dim str1 As String
    Dim str2 As String
   
    str1 = "1"
    str2 = "2"
    If str1 = str2 Then
        Msgbox ("strings are equal", "Test")
    Else
        Msgbox ("strings are different", "Test")
    End If
If you want to use SQL and get values from queries is very easy. Just search in forums. There is a lot of examples.
 
Upvote 0
Top