ElliotHC Active Member Licensed User Apr 23, 2023 #1 I am trying to create an app that is able to generate a number of lists as required in a for next loop. B4X: Private Races() As List Races().Initialize() For a = 1 to 10 For b = 1 to 5 Races(a).Add("Count=" & b) Next Next I should have 10 lists each with 5 lines as follows: Count=1 Count=2 Count=3 Count=4 Count=5 But for some reason I can't seem to get it to work. Any ideas what I'm doing wrong?
I am trying to create an app that is able to generate a number of lists as required in a for next loop. B4X: Private Races() As List Races().Initialize() For a = 1 to 10 For b = 1 to 5 Races(a).Add("Count=" & b) Next Next I should have 10 lists each with 5 lines as follows: Count=1 Count=2 Count=3 Count=4 Count=5 But for some reason I can't seem to get it to work. Any ideas what I'm doing wrong?
watesoft Active Member Licensed User Longtime User Apr 23, 2023 #2 ElliotHC said: I am trying to create an app that is able to generate a number of lists as required in a for next loop. B4X: Private Races() As List Races().Initialize() For a = 1 to 10 For b = 1 to 5 Races(a).Add("Count=" & b) Next Next I should have 10 lists each with 5 lines as follows: Count=1 Count=2 Count=3 Count=4 Count=5 But for some reason I can't seem to get it to work. Any ideas what I'm doing wrong? Click to expand... see here: https://www.b4x.com/android/forum/t...-list-etc-by-the-key-word-new.111920/#content Upvote 0
ElliotHC said: I am trying to create an app that is able to generate a number of lists as required in a for next loop. B4X: Private Races() As List Races().Initialize() For a = 1 to 10 For b = 1 to 5 Races(a).Add("Count=" & b) Next Next I should have 10 lists each with 5 lines as follows: Count=1 Count=2 Count=3 Count=4 Count=5 But for some reason I can't seem to get it to work. Any ideas what I'm doing wrong? Click to expand... see here: https://www.b4x.com/android/forum/t...-list-etc-by-the-key-word-new.111920/#content
epiCode Active Member Licensed User Apr 23, 2023 #3 B4X: Private Races(10) As List For a = 0 To 9 Races(a).Initialize For b = 1 To 5 Races(a).Add("Count=" & b) Next Next declare a specific number like races(10) and not open initialize them one by one (like inside the loop) Upvote 0
B4X: Private Races(10) As List For a = 0 To 9 Races(a).Initialize For b = 1 To 5 Races(a).Add("Count=" & b) Next Next declare a specific number like races(10) and not open initialize them one by one (like inside the loop)