mergJSONDecode

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
mergJSONDecode(<pJSON>, <pVariableName>)
Associationsmergjson
Summary

The function decodes JSON to an array.

Introduced8.0
OSios, android, linux, mac, windows
Platformsmobile, desktop, server
Parameters
NameTypeDescription
pJSON

The UTF8 encoded JSON to decode.

pVariableName

The name of the variable to decode the JSON into.

Example
function JSONToArray pJSON
    local tArray,tKeys
    repeat for each line tKey in mergJSONDecode(pJSON,"tArray")
        put JSONToArray(tArray[tKey]) into tArray[tKey]
    end repeat
    return tArray
end JSONToArray

Values
NameTypeDescription
return

A list of array keys that must be further decoded. As the externals interface can not deal with multi-dimensional arrays a recursive function must be used to decode deeply nested JSON.

Description

The function decodes JSON to an array.

Tagsexternals