I want to pass in an array to a function. I have a select statement in which an array is selected based on the value of a counter. I wanted to move out a lot of the redundant code into a new function.
the basic setup is as follows:
Function selectArray(counter)
Select Case counter
Case 0
printArray(AlphaArray())
Case 1
printArray(BetaArray())
Case 2
printArray(GammaArray())
End Select
End Function
If I put all of the "printArray" code inside the Case statements, it works fine. It seemed much nicer to have a seperate function outside the selectArray function.
I'm not sure how to handle this inside the function that recieves the array as a parameter. I keep getting "Type Mismatch" errors. I'm sure this isn't too hard, however I just started using VB, so its all hard for me .
If someone could provide some syntax I would appreciate it.
Thanks.
** variable and function names have been changed to protect the innocent.
the basic setup is as follows:
Function selectArray(counter)
Select Case counter
Case 0
printArray(AlphaArray())
Case 1
printArray(BetaArray())
Case 2
printArray(GammaArray())
End Select
End Function
If I put all of the "printArray" code inside the Case statements, it works fine. It seemed much nicer to have a seperate function outside the selectArray function.
I'm not sure how to handle this inside the function that recieves the array as a parameter. I keep getting "Type Mismatch" errors. I'm sure this isn't too hard, however I just started using VB, so its all hard for me .
If someone could provide some syntax I would appreciate it.
Thanks.
** variable and function names have been changed to protect the innocent.