• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

Randomize 3000 integers

How do I randomize 3000 integers in a vertical array?
Thanks.
0
raigam
Asked:
raigam
  • 2
1 Solution
 
raigamAuthor Commented:
I can not find any answers to it. Why do you say , "Moved"? Please help.
Thanks,
San
0
 
junglerover77Commented:
Could you describe your question more clearly so that people can understand you?

Please try to make an example for your question.

0
 
leonstrykerCommented:
San,

You originally asked your question in the VB Databases area, but your question had nothing to do with databases, therefore I moved the question to the general VB area.

In regard to your question. You should create an array of 3000 integer elements and then populate it with random numbers:

Sub RandomNum()
Dim aIntegers(2999) as Integer
Dim intCount As Integer
Dim intMax As Integer, intMin As Integer

intMax = 32767
intMin = 1
Randomize Timer
For intCount = 0 to 2999
    aIntegers(intCount) = Int((intMax - intMin + 1) * Rnd(1) + intMin)
Next
End Sub

Leon
0
 
raigamAuthor Commented:
Hi Leon,

I am sorry I could not reply to your response earlier. I have been on a new assignment, and just got the opportunity to go through my emaill.

Many thanks for your excellent solution!

Best Regards,
San
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now