I need a customized random function. The information is coming from a database. The database is enclosed. There is a column called numbers. The higher the number, the greater the probability of the song being chosen. I already have a random function. However, I cannot make it so the higher the number, the greater the likelyhood of the song being chosen. Here is an example. Let's say the playlist has 1000 songs. 100 will be chosen. 200 of those songs have a number of 10. Also, 300 have a number 80. The last 500 have a number of 50. The ones with 100 have 10 times the chances of being chosen than the ones with the number 10. The parameters I already have are array, max numbers, upperbound, and element of the array. If there needs to be one for thing fed in, then that's fine. The only things that should be edited is randoms2 and possibly information after the function to determine what song gets picked. If the function is okay, then add a few lines of code so it follows these rules. Do not change the do loop because when I use this for reals, I will not know exactly how many times to loop at design time. If you need to add anything to the SQL Statement, then comment what I already have. Leave the part where it writes the information to a file. I will use this to test how well it works. Also, keep the other parts I have because I have another function that already works that has a certain number of times between artists.
## Deliverables
A customized function where the higher the number in the numbers field, the greater the probability of it being chosen.
## Platform
Windows 98, Access 2000, and Visual Basic 6.0 Professional Edition