To iterate through items in a List

IanMc

Well-Known Member
Licensed User
Longtime User
I see the help advises to iterate through a list by using a basic For Next loop with a counter variable but I tried it this way with For Each:
B4X:
For Each i As String In Main.MyList
           clv1.AddTextItem(i, "")
Next

and it seems to work fine, is there anything here that will come back to bite me?
 
Last edited:

mc73

Well-Known Member
Licensed User
Longtime User
Not if all your list's items are strings, at least so I suppose (remember that a list can hold different types of objects).
 
Upvote 0
Top