Array-to-function-to-array question

Results 1 to 2 of 2

Thread: Array-to-function-to-array question

  1. #1
    Join Date
    Dec 1969

    Default Array-to-function-to-array question

    Simple problem I am sure, but how can I pass an array into a function, and get the resulting array assigned back to another variable? Hmmm, not sure if I said that correctly, but here&#039;s the jist of the code I am using. It&#039;s for sorting an array.<BR><BR>&#060;%<BR>dim arrTest(2,3)<BR>&#039;build array blah, blah<BR><BR>&#039;I&#039;m sure I need to dim arrSortedArray somehow...<BR>arrSortedArray = sortFunction(arrTest)<BR><BR>function sortFunction(arrayToBeSorted)<BR> &#039;sort the array, returns an array<BR>end function<BR>%&#062;<BR><BR>I&#039;m getting an error when I try that - type mismatch error.<BR><BR>Thanks,<BR>David

  2. #2
    Join Date
    Dec 1969

    Default RE: Array-to-function-to-array question

    your not returning the array from the function.<BR><BR>function sortFunction(arrayToBeSorted) <BR> &#039;sort the array, returns an array<BR> sortFunction = arrayToBeSorted <BR>end function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts