jsonAddValueString (Function)

Top  Previous  Next

Architecture:

NX32L

Firmware version:

2.10.00


jsonAddValueString adds the provided string to the end of the given JSON array, growing the size of the array by 1.

 

Input:

o : SYSHANDLE

A handle to the JSON array to add the value to.

 

value : STRING

The UTF-8 string to add.

 

Returns: INT

1

- Success.

0

- Function is not supported.

-3

- Invalid handle.

-4

- Not an array

-6

- The string is not a valid UTF-8 string or there are not enough resources available to add it.

-99

- Failed to add value

 

 

Declaration:

FUNCTION jsonAddValueString : INT;
VAR_INPUT
   o     : SYSHANDLE;
   value : STRING;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
   rc  : INT;
   arr SYSHANDLE;
END_VAR;
 
BEGIN
   ...
   // Create array
   rc := jsonCreateArray(:= arr);
   // Add string
   rc := jsonAddValueString(:= arrvalue := "Test");
   ...
END;
 
END_PROGRAM;