Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter EightData Functions (continued)

JSONGetValue Function

Overview

The JSONGetValue function returns the data type associated with a specified item in the object.

Syntax/Parameters

Syntax

var = JSONGetValue ( handle hJSON, int index, [boolean native] );

var = JSONGetValue ( handle hJSON, string item, [boolean native] );

Parameters

hJSON

A handle to a JSON Object.

index

An int value specifying object or node index within the JSON Object. Or,

item

A string representing the item to capture from the object. See Object Names at the start of the section.

native

An optional boolean value specifying to return the data in native data type form opposed as a string data type. The default value is FALSE.

Return Value

Returns either a string data type or the data type native to the requested object. The object can be an array. Use the IsError, GetLastError and GetLastErrorMessage functions to retrieve error information.

If the type is object, then the return value will be an empty array.

Remarks

The JSONGetValue function retrieves data associated with a specific node within the object. The node is “obj.name.name...” where “obj” is the root and the names are the specified location in the object.

Note that the return variable must be of the correct type. Failure to insure this can result in a run time error. Use native option or the JSONGetInteger and JSONGetString functions for simple data to avoid issues.

Note that when floating point double numbers (float type) are converted to string, the default precision of 6 digits after the decimal place is used.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic

Page revised 2024-12-13