Android Question list question

padvou

Active Member
Licensed User
Longtime User
Let's suppose we have following code:
Code:
cursor1 = SQL1.ExecQuery("select CODE, NAME,  PHONE11, LDDATE, LCDATE from BALANCE order by NAME asc")

        For i = 0 To cursor1.RowCount - 1
        cursor1.Position = i
        Slist.add(???)
        Next
       
        cursor1.close

Then we want to add the first row to another list:
Code:
Dim row As List
    Dim cols As Int   
    Dim rows As Int
    row.Initialize
        rows = Slist.Size   
        Log(Slist.Get(0))
        row=Slist.Get(0)  'Header row
       
       
        cols = row.Size

What should the code be in the questionmarks, so that each row of the Slist list can be added as an array in the row list?
 
I tried using this:
Code:
        Slist.add(cursor1.GetString2(0) & TAB & cursor1.GetString2(1) & TAB & cursor1.GetString2(2) & TAB & cursor1.GetString2(3) & TAB & cursor1.GetString2(4) & TAB & cursor1.GetString2(5) & TAB & cursor1.GetString2(6) & TAB & cursor1.GetString2(7) & TAB & cursor1.GetString2(8))

and then split it like this:
Code:
row.Add(Regex.Split("/t",Slist.Get(0)))
but the row.size returned is always 1.
 
Upvote 0
ok, I answered my own question...
Code:
row.Add(Regex.Split("/t",Slist.Get(0)))
should be
Code:
row.Add(Regex.Split("\t",Slist.Get(0)))
 
Upvote 0
Code:
    cursor1 = sql1.ExecQuery("select CODE, NAME,  PHONE11, LDDATE, LCDATE from BALANCE order by NAME asc")

  For i = 0 To cursor1.RowCount - 1
  cursor1.Position = i
      Slist.add(cursor1.GetString("colname"))
  Next
 
Upvote 0
Code:
    cursor1 = sql1.ExecQuery("select CODE, NAME,  PHONE11, LDDATE, LCDATE from BALANCE order by NAME asc")

  For i = 0 To cursor1.RowCount - 1
  cursor1.Position = i
      Slist.add(cursor1.GetString("colname"))
  Next

I get this:
java.lang.IllegalArgumentException: column 'colname' does not exist
 
Upvote 0
Back
Top