Gets all an object's member names.

Syntax

Members = SRP_JsonX_Members(Path, Delim)

Returns

The object's member names.

Parameters

ParameterDescription
PathPath to an object whose member names to get.
DelimThe delimiter to use in the final member list. Optional. Default is @FM

Remarks

SRP_JsonX_Members gets the list of member names of the object pointed to by Path. See Paths for more details. The list is not guaranteed to be in any particular order. By default, the list is @FM delimited, but you can use the Delim parameter to set your preferred delimiter.

Examples

$insert SRPJSONX

Json  = '{'
Json := '    "employees": ['
Json := '        {'
Json := '            "firstname": "John",'
Json := '            "lastname": "Doe",'
Json := '            "age": 21'
Json := '        },'
Json := '        {'
Json := '            "firstname": "Anna",'
Json := '            "lastname": "Smith",'
Json := '            "age": 32'
Json := '        },'
Json := '        {'
Json := '            "firstname": "Peter",'
Json := '            "lastname": "Jones",'
Json := '            "age": 43'
Json := '        }'
Json := '    ],'
Json := '    "nums": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],'
Json := '    "active": true,'
Json := '    "alwaysnull": null,'
Json := '    "alwaysstring": "4.321"'
Json := '}'

SRP_JsonX_Parse('MyDocument', json)
	Members = SRP_JsonX_Members('employees[2]', ',')
SRP_JsonX_End()
  • No labels