This is pretty basic I think but I'm just after some clarification on initialising Type variables please.
Given....
Is the following OK
Or do I need to explicitly initialize 't' first with...
?
Thanks.
Given....
B4X:
Sub Process_Globals
Type myType (str as String, b as Boolean, i as Int)
End Sub
B4X:
Dim t as myType = mapMyTypes.Get("type1") 'where the values in mapMyTypes are initialized myTypes
B4X:
Dim t as myType
t.initialize
t= mapMyTypes.Get("type1")
'OR
Dim t as myType=CreatemyType(...
t= mapMyTypes.Get("type1")
Public Sub CreatemyType (str As String, b As Boolean, i As Int) As myType
Dim t1 As myType
t1.Initialize
t1.str = str
t1.b = b
t1.i = i
Return t1
End Sub
Thanks.