JsonImport

Typehandler
Dictionarylibrary.json
LibraryJSON Library
Syntax
JsonImport(<pJson>)
Associationscom.livecode.library.json
Summary

Parse JSON text into a LiveCode value.

Parameters
NameTypeDescription
pJson

String containing JSON text

Values
NameTypeDescription
return

The top level value. The type depends on the JSON content.

Description

JsonImport is used to convert data encoded in JSON format into a LiveCode value. It parses pJson and returns the first top-level value found. If any syntax errors are found in pJson, an error is thrown.

The return value may be any of the following types, depending on the content of the file:

  • Array (for a JSON object)
  • List (for a JSON array)
  • String (for a JSON string)
  • Number (for any JSON number)
  • Boolean (for JSON true or false)
  • nothing (for JSON null)
Tagsjson,library,json