Passing an Array to a Procedure

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

You can declare an array in one procedure, and then pass the array to another procedure to be modified. The procedure that modifies the array does not have to return an array. Arrays are passed by reference, meaning that one procedure passes to the other a pointer to the array's location in memory. When the second procedure modifies the array, it modifies it at that same memory location. Therefore, when execution returns to the first procedure, the array variable refers to the modified array.

See Also

Understanding Arrays | Creating Arrays | Arrays and Variants | Assigning One Array to Another | Returning an Array from a Function | Sorting Arrays | Using the Filter Function to Search String Arrays | Using a Binary Search Function to Search Numeric Arrays | Searching a Dictionary