Android Question list Initialize2 - same as stuffing array in?

Albert Kallal

Active Member
Licensed User
I have this wee bit of code:

B4X:
    Dim f     As String     = "City,FirstName,LastName"                      ' field list
    Dim v     As List                                                        ' field values
    v.Initialize2(Array As Object("Jasper","Albert","Kallal"))

    Gbl.SQLUpdate(Main.mysql,"tblHotels",f,v,Main.gID)

Now I not going to call mom, but is this the same, and ok?

B4X:
    Dim f     As String     = "City,FirstName,LastName"                       ' field list
    Dim v     As List       = Array As Object("Jasper","Albert","Kallal")     ' field values

    Gbl.SQLUpdate(Main.mysql,"tblHotels",f,v,Main.gID)

Now, one extra line of code not going to hurt me, but are the above 2 ok?
Or to be safe, should one stick to using Initialize2?

They both work fine - and they are both of course resulting in a fixed list size - and that's just fine.

Regards,
Albert D. Kallal
Edmonton, Alberta, Canada
 

Albert Kallal

Active Member
Licensed User
Thank you for that wee bit of advice! I just did not want to start out writing too much code down a bad garden path.

A simple question, but I do feel better now Thank you.

Regards,
Albert D. Kallal
Edmonton, Alberta, Canada
 
Upvote 0
Top