|
-
Dec 12th, 1999, 03:39 PM
#1
How would create a random number generator between the limits of 1 and 20 for a multiple choice test??
-
Dec 12th, 1999, 05:41 PM
#2
Lively Member
See the VB help on the Rnd function
Private Function RandomNum() As Integer
RandomNum = Int((20 - 1 + 1) * Rnd + 1)
End Function
-
Dec 12th, 1999, 09:27 PM
#3
Add Randomize to hayessj's soultion or your set of random numbers will repeat each time you run the program.
Private Function RandomNum() As Integer
Randomize
RandomNum = Int((20 - 1 + 1) * Rnd + 1)
End Function
------------------
Marty
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|