Slices

BlitzMax Forums/BlitzMax Programming/Slices

Perturbatio(Posted 2005) [#1]
Is there any easy way to do something like the following (slices don't appear to support this):

assuming a and b are precreated arrays, I want to copy all the elements of the array b to a EXCEPT the 11th one.

i.e. something like:
Local a:Int []
Local b:Int[20]
a = b[0..10|12..20] 'copy all elements but the 11th one to a[], resulting in a 20 element array instead of a 21 element array.

*EDIT*

or even:
b = a[0..5]+a[7..9] 'this doesn't work



Bot Builder(Posted 2005) [#2]
This would be cool, I can't figure out how to do it without resorting to going through each one.


Perturbatio(Posted 2005) [#3]
no, nor can I :(


ImaginaryHuman(Posted 2005) [#4]
Does a[0..10]=b[0..10] ; a[11..19]=b[12.20] work?


Perturbatio(Posted 2005) [#5]
no, you get an error: Can't linearize reference