Hi,
I test a small program with type and list data type.
At Globals
At Activity_Create
But result is same and last data only as follow.
List Size
2
1st Person
Marry
Lin
18
2nd Person
Marry
Lin
18
How can I fix it?
I test a small program with type and list data type.
At Globals
'declare type
Type Person (First As String, Second As String, age As Int )
At Activity_Create
Dim List1 As List
List1.Initialize
List1.AddAll ( Array As Person() )
Public tempdata,tdata As Person
tempdata.First ="Smith"
tempdata.Second ="John"
tempdata.age =22
List1.Add (tempdata)
tempdata.First ="Marry"
tempdata.Second ="Lin"
tempdata.age =18
List1.Add (tempdata) 'Adds a second value at the end of the list
Dim s As Int
s = list1.Size
Log("List Size")
Log(s)
Log("1st Person")
tdata= List1.Get(0)
Log(tdata.First )
Log(tdata.Second )
Log(tdata.age )
Log("2nd Person")
tdata= List1.Get(1)
Log(tdata.First )
Log(tdata.Second )
Log(tdata.age )
But result is same and last data only as follow.
List Size
2
1st Person
Marry
Lin
18
2nd Person
Marry
Lin
18
How can I fix it?
Last edited: