by Cuong C. To (2 Submissions)
Category: Windows API Call/Explanation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 9th June 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
assign array
API Declarations
Using API function 'CopyMemory' to assign array to another array.
Dim sour(1 To 100) As Long, dest(1 To 100) As Long, x(1 To 50) As Long, Length as long
' copy whole array sour to dest
Length=100*4
Call CopyMemory(dest(1), sour(1), Length)
' copy elements from sour(50) to sour(99) to array x
Length=50*4
Call CopyMemory(x(1), sour(50), length)