While adding 4001 pieces of data, something goes wrong and I can see what is wrong with the code
While adding the data to the list, each entry is correct. But as soon as last enry has is added, all entries are the same as the last one.
Can someone spot, what is wrong?
While adding the data to the list, each entry is correct. But as soon as last enry has is added, all entries are the same as the last one.
Can someone spot, what is wrong?
B4X:
Sub SaveDate
Item.Initialize
For i = 10000 To 14000
Item.Clear
Private iii As String
iii=i
Item.AddAll(Array As String (iii, AllinOne(i, 1), AllinOne(i, 2), AllinOne(i, 3), AllinOne(i, 4), AllinOne(i, 5), AllinOne(i, 6), AllinOne(i, 7)))
All_Items.Add(Item)
'Here data is correct
Log(All_Items.Get(i-10000))
Next
'Here all 4001 entries in All_Items are the same as the last entry
Log(All_Items.Get(70))
File.WriteList("C:\b4j\MakeList\Files\", "AllItems.txt", All_Items)
End Sub