It would be useful to have a CreateList, similar to CreateMap.
Having it, I could write:
Currently I must write:
Note that if I wrote:
CreateTest (Array As Int ())
the list would become immutable (an Array, for that matter)
Note also (for the picky ones like me ?): obviously I would never create a custom type like that, with only one "field".
Having it, I could write:
B4X:
Type tTest(Elems As List)
Private objTest As tTest
objTest = CreatetTest(CreateList()) ' or a list of "fake numbers", like -1: CreateList(-1, -1, -1)
B4X:
Public Sub CreatetTest (Elems As List) As tTest
Dim t1 As tTest
t1.Initialize
t1.Elems = Elems
Return t1
End Sub
Currently I must write:
B4X:
Type tTest(Elems As List)
Private objTest As tTest
objTest = CreatetTest(Null)
B4X:
Public Sub CreatetTest (Elems As List) As tTest
Dim t1 As tTest
t1.Initialize
If Elems.IsInitialized = False Then
Elems.Initialize
End If
t1.Elems = Elems
Return t1
End Sub
Note that if I wrote:
CreateTest (Array As Int ())
the list would become immutable (an Array, for that matter)
Note also (for the picky ones like me ?): obviously I would never create a custom type like that, with only one "field".