<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener("load", function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <iframe src="http://www.blogger.com/navbar.g?targetBlogID=21255525&amp;blogName=Free+VB+Resources+-+Free+VB+Tools+Dow...&amp;publishMode=PUBLISH_MODE_BLOGSPOT&amp;navbarType=SILVER&amp;layoutType=CLASSIC&amp;searchRoot=http%3A%2F%2Fconradsharry.blogspot.com%2Fsearch&amp;blogLocale=en_US&amp;homepageUrl=http%3A%2F%2Fconradsharry.blogspot.com%2F" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" height="30px" width="100%" id="navbar-iframe" allowtransparency="true" title="Blogger Navigation and Search"></iframe> <div></div>

Free VB Resources - Free VB Tools Download


Tips to Copy Large Arrays Faster

You can copy arrays much faster with a simple API call:

Private Declare Sub CopyMemory Lib "kernel32" _
Alias "RtlMoveMemory" (Dest As Any, _
Source As Any, ByVal Length As Long)

Private Sub CopyArray()
Dim lngbytes As Long
Dim lngSrc(1 To 600000) As Long
Dim lngDest(1 To 600000) As Long
'
' Number of bytes equals number of array
' elements times the element length.
'
lngbytes = (UBound(lngSrc) - LBound(lngSrc) + 1) * Len(lngSrc(1))
'
' Copy the array passing the address of the start to
' the destination and source arrays and the length
' of the arrays.
'
Call CopyMemory(lngDest(LBound(lngDest)), lngSrc(LBound(lngSrc)), lngbytes)
End Sub

Labels:



           

3 Comments:

how about resource memory?
CopyMemory copies a series of bytes from one location in the computer's memory to another. CopyMemory function can be used to transfer data between any kinds of variables, arrays, data structures, or even abstract memory addresses, to use arrays, reference the first element of the array. Normally, the 'Dest' and 'Source' parameters are the variables or whatever objects' memory locations to copy to/from. If you want to use either a string variable or have a Long-type variable that identifies a different memory address (i.e., the variable acts as a pointer), the ByVal keyword must be used in front of the parameter.This functions does not return a value.
nice info man:)
» Anonymous Anonymous, 7/2/08 6:59 PM  

Add a comment..

Search

Custom Search

Posts Categories

E-Referrer List



 


     Advertise Here!
Our Partners:
 
JOIN U DROP, I FOLLOW!

Computer Resources



Free VB Resources
Free VB Tools Download