|
-
Dec 20th, 2014, 01:23 AM
#1
Thread Starter
Addicted Member
Cannot Create Random Text From Lists *Solved*
Hello everyone and happy holidays!
I have a question, how does one create random text using Random and Lists? In this example I have a list of vowels and a list of consonants, and depending on the length, it will keep adding random letters to the string, (CName). I am not recieving any new string in LabelName. I've done this example before, and it worked, so now I'm really confused! Help is greatly apprecieated, thanks!
vb Code:
Private Sub Rename()
CName = ""
Dim Length As Int32 = NumericLength.Value
Randomize()
Do Until Length < 1
Length -= 1
Dim R1 As Random = New Random
Dim ChooseLetter1 As Int32 = Math.Round(R1.Next(0, Consonants.Count))
CName += Consonants(ChooseLetter1)
Dim R2 As Random = New Random
Dim ChooseLetter2 As Int32 = Math.Round(R2.Next(0, Vowels.Count))
CName += Vowels(ChooseLetter2)
Loop
LabelName.Text = CName
End Sub
I found my error, I forgot to add in the "add characters to lists" block.
Last edited by NinjaNic; Dec 20th, 2014 at 01:41 PM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|