This measures how big each Integer variable is and returns it in a unit of bytes. The example demonstrates copying a 2 dimensional array.Īnyhow, to get the size of the variable, use the LenB function. Each dimension of the array adds a lot of size. Same thing for three or more dimensional. ![]() So for a one dimension array you'd just have the size of the variable multiplied by the number of entries in the array.įor a two dimensional like the example, you have to multiply the bounds of the dimensions by each other. The formula is: Length = (Size of Variable) * (Total Number Of Items In All Dimensions) Length is specified in bytes for the CopyMemory function. The third parameter in CopyMemory is more complicated. You'll specify this for both of the parameters, first being source array and second being destionation array. In other words, that's the array's starting address. That's where the actual array variable itself starts in memory. ![]() You'll want to specify the lower most bound of the array in each of its dimensions. Here's the technique: What you want to do is call the Win32 CopyMemory API.įor the first and second parameters, specify destination and source. ![]() Here's a quick tip for copying one array to another in Visual Basic 6.
0 Comments
Leave a Reply. |