Up |
Extract values from an other array in a new array.
fun [tab u0 [I r1]] tab u0
Return : tab u0 the new tab or nil if error
The order of the list is important. A different one will return a different array.
fun main ()=
_showconsole;
let tabRange 6 0 2 -> array in
let tabExtractL array 1::2::4::7::nil -> subarray in // a new array from 'array'
(
_fooIdTab array; // 0:2:4:6:8:10:
_fooIdTab subarray; // 2:4:8:-1: // the last element is nil (-1) because there is not the index 7 in 'array'
_fooId sizetab subarray; // 4 the size of subarray is confirmed
set subarray.3 = 25; // the last element is set
_fooIdTab subarray; // 2:4:8:25:
0;;
The first element has always the index 0.