Android Question Transpose Row Data to list

epiCode

Active Member
Licensed User
This is a generic question to seek if there are better and easier way to do the following:

I have objects in list items which are basically data returned from SQL query

I wish to transpose list H1 items to list D1 Vertically separated as individual list items:

List H1
Item0 = (alpha1, alpha2, num1, alpha3, bool1) <- Object

Target list D1 (expected result)
Item0 = alpha1
Item1 = alpha2
Item2 = num1
Item3 = alpha3
Item4 = bool1

1. What would be an easier way to do this instead of iterating over every list and array
2. Is it possible to retrieve entire row from multiple columns in a list vertically by default instead as objects?
3. I'm still learning so please be kind
 

stevel05

Expert
Licensed User
Longtime User
Maybe something like:

B4X:
Dim Result As List
Result.Initialize

For Each Item() As Object In H1
        Result.AddAll(Item)
Next

Log(Result)
 
Upvote 1
Top