array_setdata()

Sets byte data to array.

If new data is set at the end of array, data is appended, otherwise it is overwritten.

Syntax

array_setdata(hnd, pos, data);

Parameters

hnd Array handle.
pos Data position. Special values are:
0 - start position of array.
-1 - end position of array.
Other: 1,2,3… (zero based numbering is used (1st position has number zero, 2nd number one etc…)
data Byte data.
Return Value Returns array size. Returned value is integer number.

Example

hnd = array_new();
array_setdata(hnd, 0, 0x01, 0x02, 0x03, 0x04, 0x05);
result = array_printdata(hnd);
array_delete(hnd);

result:

5; 0x01, 0x02, 0x03, 0x04, 0x05

See also

array_new, array_delete, array_printdata, array_setdata16, array_setdata32, array_setdata64, array_setdataflt32, array_setdataflt64