Makes the parent of the current element the new current element.

Syntax

SRP_JsonX_GoBack()

Returns

1 if succeeded, 0 if not.

Remarks

SRP_JsonX_GoBack changes the current element to the parent of the current element.

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)

	// Make the current element the second employee
    SRP_JsonX_Go('employees[2]')

	// Make the current element the employee array
	SRP_JsonX_GoBack()

SRP_JsonX_End()
  • No labels