Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 206
  • 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

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

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