array_insert()

Inserts data filled with zeros to array.

Syntax

array_insert(hnd, pos, len);

Parameters

hnd Array handle.
pos Position of inserted data. Special values are:
0 - first position of array.
-1 - last position of array.
Other: 1,2,3… (zero based numbering is used (1st position has number zero, 2nd number one etc…) ).
len Length of data to insert.
Return Value Return value is 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_insert(hnd, 2, 3);
result = array_printdata(hnd);
array_delete(hnd);

result:

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

See also

array_new, array_delete, array_printdata, array_setdata