M
mark4asp
The result of RandList() is a list of numbers which are all the SAME.
Changing the d() function to the one which is commented out has no
effect (of course).
How can I get the function [ d() ] to return a different random number
each time?
Function RandList()
Dim str As String = ""
Dim i As Integer
For i = 1 To 100
str += d(10).toString() & ", "
Next
Return str
End Function
Function d(ByVal high) As Integer
Return New System.Random().Next(1, high+1)
End Function
' Function d(num As Integer)
' Dim RanNum As New Random
' Return RanNum.Next(1, num+1)
' End Function
Changing the d() function to the one which is commented out has no
effect (of course).
How can I get the function [ d() ] to return a different random number
each time?
Function RandList()
Dim str As String = ""
Dim i As Integer
For i = 1 To 100
str += d(10).toString() & ", "
Next
Return str
End Function
Function d(ByVal high) As Integer
Return New System.Random().Next(1, high+1)
End Function
' Function d(num As Integer)
' Dim RanNum As New Random
' Return RanNum.Next(1, num+1)
' End Function