LoadJSON()

Syntax

Result = LoadJSON(#JSON, Filename$ [, Flags])
Description
Parse JSON data from a file. The contents of the file are expected to be encoded in UTF-8 format. Files with another character encoding cannot be read by this command. The JSONValue() function can be used to access the contained JSON value(s) after parsing.

Parameters

#JSON A number to identify the new JSON. #PB_Any can be used to auto-generate this number.
Filename$ The name of the file containing the JSON data. It can be an URL or a local file identifier got with SelectedFileID().
Flags (optional) It can be one of the following value:
  #PB_LocalFile: the filename is a local file, OpenFileRequester()() needs to be called before
                 to have access to local files. SelectedFileID()() is used to get the
                 local file identifier.

Return value

Nonzero if the JSON data was parsed correctly, zero otherwise. If #PB_Any was used for the #JSON parameter then the generated number is returned on success.

Remarks

In case of an error, the JSONErrorMessage(), JSONErrorLine() and JSONErrorPosition() functions can be used to get more information about the error.

JSON is a case sensitive data format.

See Also

CreateJSON(), ParseJSON(), JSONValue(), FreeJSON(), JSONErrorMessage(), JSONErrorLine(), JSONErrorPosition()

Supported OS

All

<- JSONValue() - Json Index - NextJSONMember() ->