array_setdata16()

Sets two byte(16-bit) data to array.

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

Syntax

array_setdata16(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 Two byte data.
Return Value Returns array size. Returned value is integer number.

Example

hnd = array_new();
array_setdata16(hnd, 0, 0x0102, 0x0304, 0x0506, 0x0708);
result = array_printdata(hnd);
array_delete(hnd);

result:

8; 0x02, 0x01, 0x04, 0x03, 0x06, 0x05, 0x08, 0x07

See also

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