C cjguajardo Member Licensed User Longtime User Dec 22, 2012 #1 In CSharp i can do this: B4X: struct Asignatura{ string Nombre; int idAsig ; String Color; } List<myStruct> a= new List<MyStruct>(); but i tried to do on B4A with this: B4X: Type Asignatura(Nombre As String, idAsig As Int, Color As String) Dim a As List<Asignatura> But i get an error. Exists any form to do the same with B4A? Is it possible to do? Thanks in advance.
In CSharp i can do this: B4X: struct Asignatura{ string Nombre; int idAsig ; String Color; } List<myStruct> a= new List<MyStruct>(); but i tried to do on B4A with this: B4X: Type Asignatura(Nombre As String, idAsig As Int, Color As String) Dim a As List<Asignatura> But i get an error. Exists any form to do the same with B4A? Is it possible to do? Thanks in advance.
K kickaha Well-Known Member Licensed User Longtime User Dec 23, 2012 #2 A List can hold any object, you do not need to specify the object in the list declaration, so B4X: Dim a as List Will work. Upvote 0
A List can hold any object, you do not need to specify the object in the list declaration, so B4X: Dim a as List Will work.
Erel B4X founder Staff member Licensed User Longtime User Dec 23, 2012 #3 You can then write: B4X: Dim i As Asignatura = a.Get(x) Upvote 0