Syntax
json_Decode( cJson ) --> xValue | NILArguments
cJson
UTF-8 text containing one JSON value. A leading UTF-8 byte order mark is accepted.
Return value
The decoded value, or NIL on parse failure. A valid JSON null also returns NIL. An empty json_Error() result distinguishes successful parsing of null from a failure.
Description
Objects become hashes in source key order, arrays become arrays, and booleans become logical values. Whole numbers that fit are returned as integers. Other numbers are returned as doubles. Unicode escapes and surrogate pairs are decoded into UTF-8. Date strings remain strings.
Example
PROCEDURE Main()
LOCAL hData := json_Decode( '{ "name": "Ada", "items": [1, true, null] }' )
QOut( hData[ "name" ] )
QOut( Len( hData[ "items" ] ) )
RETURN