Hi there,
hope you can help me. I'm new to B4i and I'm trying to get For Each working.
I'm using build in SQLite and I have some rows in table with data in.
My plan is to run command that will get names from the row, and for each row it will programmatically create label.
That should get the names from the category column.
Then I have learned that I need to use
to display the item.
I'm trying to figure out, how can I use "For Each" I saw the
, but in here I have to specify how many times it will run. I would prefer that the code will run for each row in DB that is used, like in VB code.
This won't work.. What do I have to use instead of this?
hope you can help me. I'm new to B4i and I'm trying to get For Each working.
I'm using build in SQLite and I have some rows in table with data in.
My plan is to run command that will get names from the row, and for each row it will programmatically create label.
B4X:
SQLResultSet = SQL.ExecQuery("SELECT name FROM category")
That should get the names from the category column.
Then I have learned that I need to use
B4X:
SQLResultSet.NextRow
I'm trying to figure out, how can I use "For Each" I saw the
B4X:
For i = 0 TO 10
B4X:
For each i in SQLResultSet
label.text = SQLResultSet.GetString("category")
Next
This won't work.. What do I have to use instead of this?