Up |
tabExtract
Extract values from an other array in a new array.
Prototype :
fun [tab u0 I I] tab u0
- tab u0 : an array.
- I : a position to begin the extraction.
- I : a lenght of the extraction. If index are out of range, the corresponding index in the new array will receive the nil value.
Return : tab u0 the new tab or nil if error
See also :
Example :
From the index 1 of 'array', extracts 3 index. 'subarray' will contain values of index 1, 2 and 3 of 'array'.
fun main ()=
_showconsole;
let tabRange 6 0 2 -> array in
let tabExtract array 1 3 -> subarray in // new array build from 'array'
(
_fooIdTab array; // 0:2:4:6:8:10:
_fooIdTab subarray; // 2:4:6:
);
0;;
Note
The first element has always the index 0.