I'm trying to build a List of objects, and then List.Get(i) one at a time. However, when I List.Get(i), it always returns the last entry in the List. What am I doing wrong?
Here's a simplified example:
Sub Process_Globals
Type QUOTES(Symbol As String)
End Sub
Sub Globals
Dim Q As QUOTES
Dim quoteList As List
End Sub
Sub Activity_Create(FirstTime As Boolean)
quoteList.Initialize
Q.Initialize
End Sub
Sub Activity_Resume
Dim quo As QUOTES
Q.Symbol = "A"
quoteList.Add(Q)
Log ("ListSize = " & quoteList.Size & " " & Q)
Q.Symbol = "B"
quoteList.Add(Q)
Log ("ListSize = " & quoteList.Size & " " & Q)
Q.Symbol = "C"
quoteList.Add(Q)
Log ("ListSize = " & quoteList.Size & " " & Q)
For k = 0 To quoteList.Size - 1
quo.Initialize
quo = quoteList.Get(k)
Log ("K = " & k & " " & quo)
Next
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Here's a simplified example:
Sub Process_Globals
Type QUOTES(Symbol As String)
End Sub
Sub Globals
Dim Q As QUOTES
Dim quoteList As List
End Sub
Sub Activity_Create(FirstTime As Boolean)
quoteList.Initialize
Q.Initialize
End Sub
Sub Activity_Resume
Dim quo As QUOTES
Q.Symbol = "A"
quoteList.Add(Q)
Log ("ListSize = " & quoteList.Size & " " & Q)
Q.Symbol = "B"
quoteList.Add(Q)
Log ("ListSize = " & quoteList.Size & " " & Q)
Q.Symbol = "C"
quoteList.Add(Q)
Log ("ListSize = " & quoteList.Size & " " & Q)
For k = 0 To quoteList.Size - 1
quo.Initialize
quo = quoteList.Get(k)
Log ("K = " & k & " " & quo)
Next
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub