|randarray.zip||8/31/2020 2:50:09 PM||358,777|
This code demonstrates how to efficiently randomize an array of user defined type (UDT) items.
Basically, you include a "randValue" property in definition of the UDT, and any time you want to randomize the order, set this value to rnd() for each element, and then sort on that property. Pretty useful for a lot of applications. For example, I originally wrote this to randomly and repeatedly select 5-10 items from an array of thousands of members.
If you like this, please vote. If you don't like it, don't vote. I hope somebody finds something useful in this.
- Click on the "Build UDT Data" button and enter the number of items you wish to create. The listbox on the main form will be populated with the UDT items order alphabetically by last name.
- To Randomize the items, click on the "Randomize" button. You can do this over and over.
- If you want to re-order the UDT items alphabetically, click on the "Alpha" button.
Original Author: Bikeguy
Comments on this post
No comments have been added for this post.
You must be logged in to make a comment.