I have a subroutine named TeamSelection which is too long to post within this forum. However, within it, I call another subroutine named PlayerCombo. PlayerCombo is designed to generate combinations of players (based on groups of 8, 12, 16 or 20 and 4 at a time) AND creates a new array called arrFreqPlay (initially defined variant) that contains numbers reflects how frequently players have been paired up. This helps determine who should and should not get paired up based on how many times players have been paired already.
I would like to be able to pass the arrFreqPlay that was created and populated within the PlayerCombo subroutine back to TeamSelection so additional work can be done with that data.
Not sure if this is important at this point in time but, in this example, within the subroutine named PlayerCombo, the new array called arrFreqPlay is redefined by the following: arrFreqPlay(1 To UBound(lCombinations), 1 To UBound(lPairs), where UBound(lCombinations) equals 70 based on a combination of 8 players, 4 at a time and UBound(lPairs) = 6 (this will always equal 6).
At one time, I was thinking about defining arrFreqPlay as a global array within the module but did not believe that would be the best approach since I may need to use that same array within other subroutines contained within that same module. However, if a new arrFreqPlay array was needed, that array would contain a different set of values based on a new combination of players.
Example: if 12 players are available to play, the following high-level calls are made to subroutines:
Thanks for any help or guidance you can provide.
I would like to be able to pass the arrFreqPlay that was created and populated within the PlayerCombo subroutine back to TeamSelection so additional work can be done with that data.
Not sure if this is important at this point in time but, in this example, within the subroutine named PlayerCombo, the new array called arrFreqPlay is redefined by the following: arrFreqPlay(1 To UBound(lCombinations), 1 To UBound(lPairs), where UBound(lCombinations) equals 70 based on a combination of 8 players, 4 at a time and UBound(lPairs) = 6 (this will always equal 6).
At one time, I was thinking about defining arrFreqPlay as a global array within the module but did not believe that would be the best approach since I may need to use that same array within other subroutines contained within that same module. However, if a new arrFreqPlay array was needed, that array would contain a different set of values based on a new combination of players.
Example: if 12 players are available to play, the following high-level calls are made to subroutines:
- Call TeamSelection (procedures to help determine which players will fill court 1)
- Call Player Combo (generates list based on 12 players, 4 at a time) and creates arrFreqPlay
- Would like TeamSelection to use the results of arrFreqPlay to help identify best combination of 4 to fill first court
- Call TeamSelection2 (procedure would be called because 8 players remain to be grouped together)
- Call Player Combo (list based on 8 players, 4 at a time) and creates arrFreqPlay (again)
- Would like TeamSelection2 to use the results of arrFreqPlay to help identify best combination of the next 4 players to fill second court
- After second court is determine, only 4 players remain to fill third and final court so no further "calls" are required.
Thanks for any help or guidance you can provide.