Android Question Is there a way to create/return an explicit cast of a List/Map.

Martin D.

Member
Licensed User
Ex:

B4X:
Dim myLife as Map (As yearstring, As Wine)

If myLife.Get("2019").IsTonsOfWine = True Then...
Because I haven't found any with the IDE or in the forums.

That would be a huuuuuuuuuuuuuuuuuuuuuuuge time saver I believe.

Thanks !
 

Erel

Administrator
Staff member
Licensed User
No. However you can create a helper sub:
B4X:
Sub GetWine (Year As String) As Wine
 Return myLife.Get(Year)
End Sub
(or pass the map as the first parameter if there are several maps)

B4X:
If GetWine("2019").IsGood Then
 
Top