Porovnávané verzie

Kľúč

  • Tento riadok sa pridal
  • Riadok je odstránený.
  • Formátovanie sa zmenilo.

%JSON_ArraySetValue function


Function

Replace Replaces an item at a given index in the JSON array by value.

Declaration


Blok kódu
languageesl
themeConfluence
%JSON_ArraySetValue(
    INT in handle, 
    INT in index,
    UNIVAL in value
 )


Parameters


handleHandle to parent JSON array.
indexIndex
valueNew value


Return value

None

Description

Function replace replaces an item at a given index in the JSON array by value. Supported types are BOOL, INT, REAL, TEXT and invalid value. If you want to insert TIME, first you have to convert it to TEXT first.

Exception is thrown if handle to parent JSON array is invalid, new value have unsupported type or index is out of range.

Example


Blok kódu
languageesl
themeRDark
 INT _arr
 _arr := %JSON_CreateArray()
 
 %JSON_ArraySetLength(_arr, 5)

 %JSON_ArraySetValue(_arr, 1, "IPESOFT")
 %JSON_ArraySetValue(_arr, 2, 365)
 %JSON_ArraySetValue(_arr, 3, 1.234)
 %JSON_ArraySetValue(_arr, 4, @TRUE)
 %JSON_ArraySetValue(_arr, 5, U.uservariable)

 %JSON_FreeArrayHandle(_arr)