jsonFree releases the resources used by a JSON object or array.
Input:
o : SYSHANDLE
A handle to the JSON object or array to release. Will be made invalid once it has been released.
Returns: INT
1
|
- Success
|
0
|
- Function is not supported.
|
-3
|
- JSON structure was not found.
|
Declaration:
FUNCTION jsonFree : INT;
VAR_INPUT
o : ACCESS SYSHANDLE;
END_VAR;
Example:
INCLUDE rtcu.inc
PROGRAM test;
VAR
rc : INT;
arr : SYSHANDLE;
obj : SYSHANDLE;
END_VAR;
BEGIN
...
rc := jsonCreateArray(o := arr);
rc := jsonAddValueInt(o := arr, value := 123);
rc := jsonCreateObject(o := obj);
rc := jsonSetValueInt(o := obj, key := "Number", value := 42);
rc := jsonSetValue(o := arr, idx := 0, value := obj);
rc := jsonFree(o := obj);
...
END;
END_PROGRAM;
|