Daestrum Expert Licensed User Longtime User Jan 14, 2014 #1 Would it be possible to have the constructors(initialize) return the object. for example, B4X: Dim AmenuItem As MenuItem Dim AList As List ....... AmenuItem.Initialize("A","procA")) AList.Add(AmenuItem) ...... could become B4X: AList.Add(AmenuItem.Initialize("A","procA")) if the initialize for the menuItem returned the object instead of void.
Would it be possible to have the constructors(initialize) return the object. for example, B4X: Dim AmenuItem As MenuItem Dim AList As List ....... AmenuItem.Initialize("A","procA")) AList.Add(AmenuItem) ...... could become B4X: AList.Add(AmenuItem.Initialize("A","procA")) if the initialize for the menuItem returned the object instead of void.
Erel B4X founder Staff member Licensed User Longtime User Jan 15, 2014 #2 It cannot be changed automatically. It will require update to the Initialize methods in the libraries. I agree that it makes sense in many cases. It will be considered.
It cannot be changed automatically. It will require update to the Initialize methods in the libraries. I agree that it makes sense in many cases. It will be considered.