Sub Reverse(m As Map, p As String)
For i = 0 To m.Size - 1
Dim k As Object = m.GetKeyAt(i)
Dim v As Object = m.GetValueAt(i)
If v Is Map Then
Reverse(m.Get(k), "/" & k)
Else
Log(p & "/" & k)
End If
Next
End Sub
Usage example:
B4X:
Dim m As Map
m.Initialize
m.Put(1, "abc")
m.Put(2, CreateMap(1 : "abc", 2 : "def"))
m.Put(3, CreateMap(1 : "abc", 2 : "def", 3 : CreateMap(1 : "abc", 2: "def")))
Reverse(m, "")
Hi Erel
I want to get proprly path (not a item sort) of map items
Like a reverse search in the filesystem where the "Map" is a folder name and the filename is a string key of the map