|
-
May 2nd, 2002, 07:05 AM
#1
Problem with Rnd
Ok... I want to make an app that shows a random message at startup, so I created a Sub called Greet that has the following code:
VB Code:
Select Case Int((6 * Rnd) + 1)
Case 1
...
Case 2
...
Case 3
...
Case 4
...
Case 5
...
End Select
And when I run the application, a strange thing happen, when I call the Procedure from Form_Load the message displayed is always the same BUT when I run it from a command button Click event the procedure works, I have a random message each time I press the button but not when I load the form.
If anyone knows why and eventually how to solve it please tell me, 'cuz I'm getting mad with this 
Thanks in advance,
DarioXP
-
May 2nd, 2002, 07:16 AM
#2
Hyperactive Member
Did you remember to put Randomize in the form load section?
-Show me on the doll where the music touched you.
-
May 2nd, 2002, 07:19 AM
#3
Ehr...
-
May 2nd, 2002, 07:19 AM
#4
-
May 2nd, 2002, 07:21 AM
#5
OH YEAH! It works thank you
-
May 2nd, 2002, 07:32 AM
#6
Hyperactive Member
No problemo my funk soul brotha'.
-Show me on the doll where the music touched you.
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
|