Wish [BANano] [SOLVED]- 1.21 Map Object Enhancements

Mashiane

Expert
Licensed User
Longtime User
Hi there

The B4J Map object has two properties

1. Keys
2. Values

Just learned the hard way that, the BANano map.Keys values returns the actual map object whilst the Values returns an error. If these might not work as expected, perhaps the logs should reflect an error that one should use GetKeyAt and GetValueAt instead.

Thanks.
 

Mashiane

Expert
Licensed User
Longtime User
Just found something else whilst trying to work on themes...

B4X:
Dim fName As String = "Anele"
    Dim sName As String = "Mbanga"
    Dim a As Map = CreateMap("firstname":"Anele Mbanga","surname":"Mbanga")
    Log(a)
    Dim b As Map = CreateMap("firstname":fName,"surname":"Mbanga")
    Log(b)
    Dim c As Map = CreateMap("firstname" : fName, "surname" : "Mbanga")
    Log(c)

The first (a) and the last maps (c) work, the second one (b) returns an error of 'fname' not defined. The only difference between the b and the c map is the spacing.
 

Mashiane

Expert
Licensed User
Longtime User
Im also trying to access Map objects between different classes and or modules. Whilst a map will work perfectly inside its own defined class, getting it from another class returns a blank object {} and also running .ContainsKey always returns false.

Executing Log(m) gets executed to the B4J logs and not on console.log()

Thanks.
 
Top