Re: Copy portions of array
- From: alpine <alpine_don'tsendspam@xxxxxxxx>
- Date: Thu, 21 Dec 2006 11:48:54 -0700
Do you really need to copy the data or could you work on it in place
if you just had a pointer to the section of the array you need to work
on?
Bryan
_________________________________________________________
Bryan Stafford "Don't need no more lies"
New Vision Software - Neil Young -
www.mvps.org/vbvision Living With War : The Restless Consumer
alpineDon'tSpam@xxxxxxxx
On Thu, 21 Dec 2006 12:32:48 -0600, "wxforecaster"
<wxforecaster@xxxxxxxxx> wrote:
What rest of the story? (There isn't much to add).
I have situation involving a very large byte array (potentially some
10-20MB) in size. I need to routinely copy small portions of this array
(some 300-400 bytes in size) to another byte array (of that dimention) for
processing.
It sounds like CopyMemory is the most efficient means of tackling this, but
if there are alternatives, I'm willing to here them. I'm going for speed
here. Right now the current procedure involves a for loop, setting each
array element individually.
Evan
"alpine" <alpine_don'tsendspam@xxxxxxxx> wrote in message
news:8ljlo2h9745oecrrpvn6nsumjf49utvpmj@xxxxxxxxxx
OK, what about the rest of the story? The more information you
provide, the more specific an answer can be. With what you've
provided so far, there is still a wide range of possibilities.
Bryan
_________________________________________________________
Bryan Stafford "Don't need no more lies"
New Vision Software - Neil Young -
www.mvps.org/vbvision Living With War : The Restless Consumer
alpineDon'tSpam@xxxxxxxx
On Thu, 21 Dec 2006 11:23:12 -0600, "wxforecaster"
<wxforecaster@xxxxxxxxx> wrote:
Specifically all the data in all the arrays are of the byte data type.
Evan
"alpine" <alpine_don'tsendspam@xxxxxxxx> wrote in message
news:1vflo2553u8j6p068ca0grcu10564f942v@xxxxxxxxxx
On Thu, 21 Dec 2006 10:48:27 -0600, "wxforecaster"
<wxforecaster@xxxxxxxxx> wrote:
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).
A lot depends on what your data looks like. If you have variable
length strings in your data, it would also depend on whether you
actually want to *copy* the data or *move* it.
If you provide more info, it will help you get a more complete answer.
HTH,
Bryan
_________________________________________________________
Bryan Stafford "Don't need no more lies"
New Vision Software - Neil Young -
www.mvps.org/vbvision Living With War : The Restless Consumer
alpineDon'tSpam@xxxxxxxx
.
- References:
- Copy portions of array
- From: wxforecaster
- Re: Copy portions of array
- From: alpine
- Re: Copy portions of array
- From: wxforecaster
- Re: Copy portions of array
- From: alpine
- Re: Copy portions of array
- From: wxforecaster
- Copy portions of array
- Prev by Date: Re: Copy portions of array
- Next by Date: Re: Developer Use of Visual Basic Plummets
- Previous by thread: Re: Copy portions of array
- Next by thread: Re: Copy portions of array
- Index(es):
Relevant Pages
|