This is a real newbie question, but I cannot read the records in a list with types in it. The code below shows what I am trying to do but for some reason(probably very silly) I only get the last record.
Thanks for your help.
Charles :sign0085:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim List1 As List
Type Test(num As Int, let As String)
Dim Demo As Test
End Sub
Sub Activity_Create(FirstTime As Boolean)
List1.Initialize
Loaddata
Fetchdata
End Sub
Sub Loaddata
Demo.num = 1
Demo.let = "A"
List1.Add(Demo)
Demo.num = 2
Demo.let = "B"
List1.Add(Demo)
Demo.num = 3
Demo.let = "C"
List1.Add(Demo)
Demo.num = 4
Demo.let = "D"
List1.Add(Demo)
End Sub
Sub Fetchdata
Dim Tempdata As Test
Tempdata.Initialize
Dim i, tnum As Int
Dim tlet As String
For i = 0 To List1.Size - 1
Tempdata = List1.Get(i)
tnum = Tempdata.num
tlet = Tempdata.let
Msgbox(i &" " & tnum & tlet," ")
Next
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Thanks for your help.
Charles :sign0085:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim List1 As List
Type Test(num As Int, let As String)
Dim Demo As Test
End Sub
Sub Activity_Create(FirstTime As Boolean)
List1.Initialize
Loaddata
Fetchdata
End Sub
Sub Loaddata
Demo.num = 1
Demo.let = "A"
List1.Add(Demo)
Demo.num = 2
Demo.let = "B"
List1.Add(Demo)
Demo.num = 3
Demo.let = "C"
List1.Add(Demo)
Demo.num = 4
Demo.let = "D"
List1.Add(Demo)
End Sub
Sub Fetchdata
Dim Tempdata As Test
Tempdata.Initialize
Dim i, tnum As Int
Dim tlet As String
For i = 0 To List1.Size - 1
Tempdata = List1.Get(i)
tnum = Tempdata.num
tlet = Tempdata.let
Msgbox(i &" " & tnum & tlet," ")
Next
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub