Sub Button1_Click
xui.MsgboxAsync("Hello world!", "B4X")
Dim lstCardsList As List
lstCardsList.Initialize
For iIndex = 0 To 5
Dim TCard1 As TestType
TCard1.Initialize
TCard1.CardNumber = "1234" & iIndex
TCard1.CVV = NumberFormat2(iIndex, 3, 0,0,False )
lstCardsList.Add(TCard1)
Next
Log($"Size of Cards List: ${lstCardsList.Size}"$)
mSettings.Put( "Cards", lstCardsList )
Dim lstNothingReadBack As List
lstNothingReadBack.Initialize
GetCards(lstNothingReadBack)
Log($"Size of Cards List: ${lstNothingReadBack.Size}"$)
End Sub
Private Sub GetCards( lstCards As List)
'Doesn't read back anything
' NO REASON to initialize the given list!!!!!
'lstCards.Initialize
'lstCards = mSettings.Get("Cards")
' Dim lstLocalCards As List
lstLocalCards.Initialize
lstLocalCards.AddAll(mSettings.Get("Cards"))
For iIndex = 0 To lstLocalCards.Size -1
Dim TCard1 As TestType
TCard1.Initialize
TCard1 = lstLocalCards.Get(iIndex)
lstCards.Add( TCard1 ) 'lstLocalCards2 Size increases by 1
Next
'Return lstLocalCards2 'Size 18 entries ; second round size 54
' As you are given a List. Use use this list. No need to return it
End Sub