folletxavier
asked on
Array to array
Is there a fast(no loops) way to copy the content of an array to another array?
I actually need to copy the value of the fields 5 to 9 from a first array( dim myFirstArr(0 to 9) ) to a second array (dim mySecondArr(0 to 4)).
Thanks.
/Xavier
I actually need to copy the value of the fields 5 to 9 from a first array( dim myFirstArr(0 to 9) ) to a second array (dim mySecondArr(0 to 4)).
Thanks.
/Xavier
It depends on what the array contains. Under certain circumstances, it's possible to use rtlmovememory to copy the array contents at a low level. You'll have problems doing this however if the array contains objects or (I think, though I'm not 100% sure) variable length strings.
ASKER
>>It depends on what the array contains
My arrays are byte arrays.
Do you have some code demonstrating the use of rtlmovememory?
/Xavier
My arrays are byte arrays.
Do you have some code demonstrating the use of rtlmovememory?
/Xavier
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
For the above to work make sure you define the arrays with code like "Dim myFirstArr(0 to 9) As Byte" and "Dim mySecondArr(0 to 4) As Byte".
ASKER
I actually had time to find out about it myself but your code is exactly what I found so full points for you.
Thanks
/Xavier
Thanks
/Xavier
VBMaster - you got there first!
ASKER
A problem with EE is that only one can get the grade and the points... This results in unfair question validation. I was forced to give points to 1 of you guys though you worked on it both.
Sorry
/Xavier
Sorry
/Xavier
No worries. It sometimes adds to the fun - trying to type an answer out as quickly as possible before somebody else gets in :)
ASKER
Cool!
Thanks again
'Till next time!
Reguards
/Xavier
Thanks again
'Till next time!
Reguards
/Xavier