JsonParse Function

Action

Creates a new JSON object or a new JSON array from the given string.

It is highly recommended to delete every parsed JSON object and every parsed JSON array from the memory when it is not needed any longer. For every call of JsonParse should be a call of JsonFree.

Include file

Json.bdh

Syntax

JsonParse( in jsonText : string ): number;
Parameter Description
jsonText The string representation of the new JSON object or the new JSON array

Return value

  • handle to a JSON object or a JSON array if successful
  • 0 otherwise

Example

transaction TMain
var
  jsonText   : string;
  jsonObject : number;
begin
  WebParseDataBound(jsonText);
  WebPageUrl("http://mycompany.com/api/jsondata");
  jsonObject := JsonParse(jsonText);
  
  ...

  JsonFree(jsonObject);
end TMain;