Return Maximum Combinations of a Number Range

Category:
Dates and Math
Type:
Snippets
Difficulty:
Intermediate
Author:
Erdogan Tan

Version Compatibility: Visual Basic 6, Visual Basic 5

More information:
This function calculates and returns maximum possible number of combinations for r elements of n elements (heap). I use it in my lotto 6/49 program to determine the maximum number of combinations of the range 6-49 (e.g., (Combination(49, 6) returns 13983816).

Please visit http://www.singlix.com/download/combinator.html for details...

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: