A apty Active Member Licensed User Longtime User Sep 11, 2018 #1 I have a for loop where i am looping through a list. There is also another list but i only need a few items from this list. For example, my list has the following information: The list i am using to loop (list 1): Code: Copy Depart flight, Price A, Location A Depart flight, Price B,Location A The second list Code: Copy Return flight, Price C, Location C Now i want to return the data as below after looping through the list: Depart flight,Price A,From:Location A,To:Location C Depart flight,Price B,From:Location A,To:Location C Return flight,Price C,From:Location C,To:Location A If i try looping using 1st list i get index out of bounds error when trying to pick Location C on depart flight
I have a for loop where i am looping through a list. There is also another list but i only need a few items from this list. For example, my list has the following information: The list i am using to loop (list 1): Code: Copy Depart flight, Price A, Location A Depart flight, Price B,Location A The second list Code: Copy Return flight, Price C, Location C Now i want to return the data as below after looping through the list: Depart flight,Price A,From:Location A,To:Location C Depart flight,Price B,From:Location A,To:Location C Return flight,Price C,From:Location C,To:Location A If i try looping using 1st list i get index out of bounds error when trying to pick Location C on depart flight
Jeffrey Cameron Well-Known Member Licensed User Longtime User Sep 11, 2018 #2 Without seeing the code you're using to populate the list, it is impossible to answer your question. Since I have to guess, my best guess would be make sure your loop is going from zero to list.Size - 1. Upvote 0
Without seeing the code you're using to populate the list, it is impossible to answer your question. Since I have to guess, my best guess would be make sure your loop is going from zero to list.Size - 1.
ilan Expert Licensed User Longtime User Sep 11, 2018 #3 apty said: If i try looping using 1st list i get index out of bounds error when trying to pick Location C on depart flight Click to expand... post your code Upvote 0
apty said: If i try looping using 1st list i get index out of bounds error when trying to pick Location C on depart flight Click to expand... post your code
LucaMs Expert Licensed User Longtime User Sep 12, 2018 #4 https://www.b4x.com/android/forum/threads/i-count-from-zero.97133/ ? Upvote 0