To simplify the example, we will skip the sorting of the input array, but instead generate a random array whose elements are already sorted in ascending order. The GenerateRandomSortedArray function will do this: it simply fills an array with random values, each value greater than the previous one. A generated array is the result that must be returned from the function. But the function return value can only be a scalar; it is not possible to return an array directly as a function value. A ByVar parameter can help us to work around this problem. If we pass an array variable to GenerateRandomSortedArray by reference, any changes made inside the function will be visible to the calling code. Let's see how this works.
Inside the function, declare an InputArray parameter of type Integer and set the checkmark in the Var field. To complete...