Επεξεργασία

Κοινή χρήση μέσω


JsonArray.ReadFrom(InStream) Method

Version: Available or changed with runtime version 1.0.

Reads the JSON data from the stream into a JsonArray variable.

Syntax

[Ok := ]  JsonArray.ReadFrom(Data: InStream)

Parameters

JsonArray
 Type: JsonArray
An instance of the JsonArray data type.

Data
 Type: InStream
The InStream object from which the JSON data will be read.

Return Value

[Optional] Ok
 Type: Boolean
true if the read was successful; otherwise, false. If you omit this optional return value and the operation does not execute successfully, a runtime error will occur.

Remarks

This method can fail if the stream is in an invalid state or if the JSON data is malformed. If the operation succeeds, the JsonArray will be disconnected from its current JSON tree and the data contained by the JsonArray will be replaced with the new value. To delete the contents in a JsonArray variable use the Clear function.

Clear(JsonArray)

Example

This example shows how to read JSON data from a stream into a JsonArray variable.

local procedure ReadJson(source : InStream) result : JsonArray
begin
    result.ReadFrom(source);    
end;

JsonArray Data Type
Get Started with AL
Developing Extensions