For example I have a custom type variable named RuntimeConfig declared in Starter module. This custom type contains UserDetails map. To get a value from UserDetails in Main activity I should use the following:
If a lot of such addressing happens, even in one string sometimes, the code becomes bulky and ugly. It is possible to declare UserDetails as shortcut:
It works with all object variable types, but is it Ok to use?
B4X:
Starter.RuntimeConfig.UserDetails.Get("FieldName")
If a lot of such addressing happens, even in one string sometimes, the code becomes bulky and ugly. It is possible to declare UserDetails as shortcut:
B4X:
Dim ud as Map = Starter.RuntimeConfig.UserDetails
If ud.Get("FieldName") = "someText" Then ud.Put("FieldName", TextField1.Text)
It works with all object variable types, but is it Ok to use?
Last edited: