# Problem generating unique alpha-numeric number en mass

Page 1 of 1

## 1 Replies - 4073 Views - Last Post: 04 March 2008 - 09:59 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'https://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=44917&amp;s=a2e979adc262077b5dd14ae33dd0678e&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 ChaosEdict

Reputation: 0
• Posts: 3
• Joined: 02-March 08

# Problem generating unique alpha-numeric number en mass

Posted 02 March 2008 - 05:40 PM

I am in need of help. I have a working generator for 6 digit alpha-numeric numbers, here is the clincher, i need to generate 500 unique values on form load to populate a listbox. When i attempt to put it on a loop, it just generates the same number over and over again. Any ideas?

```Dim rand As New Random
Dim int As Integer
Dim count As Integer
Dim counter As Integer = 0
Dim pass As String = ""

Do Until counter = 500
Do Until count = 6
int = rand.Next(2)
If int = 1 Then
pass = pass & alpha(rand.Next(25))
Else
pass = pass & numeric(rand.Next(9))
End If
count = count + 1
Loop
pass = ""
counter = counter + 1
Loop

```

Alpha() and Numeric() have already been populated with the appropriate vaules.

~Mac

Is This A Good Question/Topic? 0

## Replies To: Problem generating unique alpha-numeric number en mass

### #2 ChaosEdict

Reputation: 0
• Posts: 3
• Joined: 02-March 08

## Re: Problem generating unique alpha-numeric number en mass

Posted 04 March 2008 - 09:59 AM

I figured out the problem, the trouble was that i had placed the code under a button, that and i forgot to put the variable count back to zero.

Page 1 of 1

 .related ul { list-style-type: circle; font-size: 12px; font-weight: bold; } .related li { margin-bottom: 5px; background-position: left 7px !important; margin-left: -35px; } .related h2 { font-size: 18px; font-weight: bold; } .related a { color: blue; }