08-17-2022, 02:13 PM
#3) This is generally a way to efficiently copy one variable or block of memory to another. Where we see this used the most is if we want to copy ArrayA() over into ArrayB() for whatever reason. Now, we could write code such as:
FOR i = LBOUND(ArrayA) TO UBOUND(ArrayA)
ArrayB(i) = ArrayA(i)
NEXT
But the above would copy one element at a time until it copied the whole array. The _MEMPUT as you have shown it, would copy the *whole* array all at once from ArrayA to ArrayB, with one pass, making it a whole lot faster and more efficient.
FOR i = LBOUND(ArrayA) TO UBOUND(ArrayA)
ArrayB(i) = ArrayA(i)
NEXT
But the above would copy one element at a time until it copied the whole array. The _MEMPUT as you have shown it, would copy the *whole* array all at once from ArrayA to ArrayB, with one pass, making it a whole lot faster and more efficient.