Why there is difference depending on the declaration place?

Penko

Active Member
Licensed User
Longtime User
Hello!

Why is there difference when I declare this way:



B4X:
Dim theList as List :theList.Initialize

For i = 0 To thedata.Size - 1

       
        Dim thisTest As Tests
      thisTest = thedata.Get(i)

theList.Add(thisTest)

Next

versus:

B4X:
Dim thisTest as Tests
above the For loop?

I also tried thisTest.Initialize at the beginning of the loop but it didn't help either.

With the faulty snippet I get basically 4 identical items !?
 
Top