B4A Class Get value from complex structure (combination of map, list, array)

Discussion in 'Additional libraries, classes and official updates' started by spsp, Apr 4, 2019.

  1. spsp

    spsp Member Licensed User

    Hello,

    This is a module code to retrieve value from complex structure (combination of list, map, array and primitives types).

    Give the path with a dot (.) separator to get the value or the default value if not accessible.

    example : m=createmap("Name":"John" ,"Friends":array as map(createmap("Name":"Alan","Age":30),createmap("Name":"Mary","Age":28)))

    get(m,"Friends.1.Age","Not Found") returns 28

    get(m,"Friends.3.Age","Not Found") returns "Not Found"

    This module runs on B4J and B4A

    spsp
     

    Attached Files:

    Last edited: Apr 6, 2019
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice