This is Lottery program which generate random numbers, but output is not sorted. How to sort numbers in asceding order?
This is VBA Express.
PublicClass ltaForm
PrivateSub GetNumbersToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GetNumbersToolStripMenuItem.Click
Dim intForLoopCtr AsInteger = 0
Dim blnFullSetComplete AsBoolean = False
Dim intRndNo AsInteger = 0
Dim strDisplayString AsString = ""
Dim intNoOfValidPics AsInteger = 0
Dim aintLotteryArray(10) As Array
Dim intNumberCount AsInteger = 0
Dim strTestString AsString = "_"
If txtFullSet.Text = ""Then
MessageBox.Show("You must specify how many numbers " & _
"make up a full set.")
Return
EndIf
If IsNumeric(txtFullSet.Text) = FalseThen
MessageBox.Show("You must specify numeric input when " & _
"specifying how many numbers make up a full set.")
Return
EndIf
For intForLoopCtr = 1 ToCInt(txtNoPics.Text)
DoUntil blnFullSetComplete = True
Randomize()
intRndNo = _
FormatNumber(Int((txtNoRange.Text * Rnd()) + 1))
If InStr(strTestString, _
Convert.ToString("_" & intRndNo & "_")) = 0 Then
strDisplayString = strDisplayString & " " & _
intRndNo & ControlChars.Tab
intNoOfValidPics = intNoOfValidPics + 1
strTestString = strTestString & intRndNo & "_"
EndIf
If intNoOfValidPics = Int32.Parse(txtFullSet.Text) Then
blnFullSetComplete = True
strDisplayString = strDisplayString & _
ControlChars.NewLine & ControlChars.NewLine
strTestString = "_"
EndIf
Loop
blnFullSetComplete = False
intNoOfValidPics = 0
Next
txtOutput.Text = strDisplayString
GetNumbersToolStripMenuItem.Enabled = False
ClearToolStripMenuItem.Enabled = True
EndSub