Copy portions of array



Say I have an array with 5000 elements in it
arr(4999)

I want to copy a portion of that array (say elements 100 to 400) to a new
array:
arr2(300)

Is there a more efficient and quicker way to perform this action vs. a for
loop???

For i = 100 to 400
arr2(i-100) = arr(i)
Next i

I'm dealing with some very large data sizes here (this was just an arbitrary
example).

Evan


.



Relevant Pages

  • Re: <ctype.h> toLower()
    ... > No the strlen in the loop is not an example that has been made efficient. ... > It's not quicker to run on every implementation, maybe it is if a lookup ... > array is used but then your incurring the overhead of the array. ... > No it doesn't rely on anything imagine it is part of a windows program. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Array and resize
    ... I will check whether this is also a quicker way to create such a matrix ... >> You are not creating a 2D array, but an array containing arrays, and you ... >> can't drop these onto a worksheet in this way. ... >>> Sub DumpValues() ...
    (microsoft.public.excel.programming)
  • Re: Copy portions of array
    ... Is there a more efficient and quicker way to perform this action vs. a for ... I'm dealing with some very large data sizes here (this was just an arbitrary ... length strings in your data, it would also depend on whether you ...
    (microsoft.public.vb.general.discussion)
  • Re: [PHP] Better way to store data in memory?
    ... Having to do some complex per pixel manipulation, ... way of storing the pixel data than in an array? ... I was looking at the Shared Memory functions, ... but I doubt that would be much quicker. ...
    (php.general)
  • Re: Heres a Python-like range() for JavaScript. Is it new?
    ... for (i in array) ... and no slower for small ones". ... I think this is worth investigating. ... Well, as I recall, it is quicker in Python, because the test and increment are done by native methods rather than using interpreted code. ...
    (comp.lang.javascript)