Help with Visual Basic Program

Aznguy1872

Senior member
Aug 17, 2005
790
0
0
Hi, so I've been working on this program for awhile and finally hit a road block. So this program should beable to take input from the user (the user decides on how many digits there will be that will be random)then the program should generate the random numbers and print them. And lastly it should swap the order of it. What I have so far is

Public Class Form1
Structure Individual
Dim gene() As Integer
End Structure
Dim original As Individual
Dim reverse As Individual

Private Sub DigitTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DigitTextBox.TextChanged
Dim digit As Integer
digit = Integer.Parse(originalTextbox.ToString)
initialization(digit)

End Sub
Private Sub initialization(ByVal inputInteger)
Dim generateRandomInteger As Integer
Dim generateRandom As Random = New Random(DateTime.Now.Millisecond)
generateRandomInteger = generateRandom.Next(10)

End Sub

Private Sub initializationButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles initializationButton.Click
originalNumberInteger = Integer.Parse(DigitTextBox.Text) - 1
End Sub
End Class

Any advice would be great. Thanks.
 

KB

Diamond Member
Nov 8, 1999
5,402
386
126
What is the exact problem you are trying to solve? Try solving one at a time. Are you trying to figure out how to create the random numbers into an array?

Private Sub initialization(ByVal inputInteger As Integer)
Dim generateRandomInteger As Integer
Dim generateRandom As Random = New Random() 'empty constructor will seed it with the tick count

Dim arrayl As new ArrayList 'I use an array list so I don't have to ReDim the array
For i As Integer = 0 To inputInteger 'create random numbers up until the count
arrayl.Add(generateRandom.Next(10)) 'add to arraylist
Next

original.gene = arrayl.ToArray(GetType(Int32)) 'convert the arraylist to a type
'I am not sure why you are using a structure for this

End Sub


 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |