B4J Library [B4X] An Inline Map Key Chooser - A Small Helper Class

If like me you keep having the annoying problem of the wrong case or the wrong spelling for keys, you might like this.
The class (50 lines of code) is in the attached .zip It is simple to use, and easy to understand.

B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    MKC.Initialize(Root)
End Sub

Private Sub Button1_Click
    'Private MKC As MapKeyChooser in Globals
    Dim anyMap As Map = CreateMap()
    For i = 1 To 10
        anyMap.Put("Key" & i, "ABCDEFGHIJKLMNOP".CharAT(i -1))
    Next
    MKC.ChooseKey(anyMap, "anyMap")
   
    'After choice, find on Log: anyMap.Get("Key5")
End Sub
 

Attachments

  • demoMKC2.zip
    9.3 KB · Views: 155
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…