Porovnávané verzie

Kľúč

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

%JSON_ArraySetLength function


Function

Set Sets the length of an array.

Declaration


Blok kódu
languageesl
themeConfluence
%JSON_ArraySetLength(
    INT in handle, 
    INT in length
 )


Parameters


handleHandle to JSON array.
lengthNew length of array


Return value

None

Description

Function set length of arrayThe function sets the array length to the specified value. If the new length is greater less than previousthe original, the items at the end of array the field will be set to nulldeleted. If the new length is smaller than previous, item at then end of array will be removed.greater than the original array length, the New Items will be set to null.

If it is an invalid handle on a JSON array or the specified length is less than 0, an exception is thrownException is thrown if handle to JSON array is invalid or length is lower than 0.

Example


Blok kódu
languageesl
themeRDark
 INT _arr
 _arr := %JSON_CreateArray()
 
 %JSON_ArraySetLength(_arr, 2)
 %JSON_ArraySetValue(_arr, 1, 1.234)
 %JSON_ArraySetValue(_arr, 2, 3.142)

 %JSON_FreeArrayHandle(_arr)