|
-
Jul 10th, 2006, 01:31 PM
#1
Thread Starter
New Member
Random Number Generator Coding
In my database I want to give players ratings but based 3 levels. Good, Mediocre or Poor. If I select Good then it should give ratings between 7 and 9, mediocre 5 and 7 and poor 3 and 5.
eg
Name Level Passing Free Kicks Tackling Shooting
Beckham Good 9 9 7 8
-
Jul 10th, 2006, 01:41 PM
#2
Re: Random Number Generator Coding
Hmmm... Yes....
So is there a question in there somewhere?
-
Jul 10th, 2006, 01:43 PM
#3
Re: Random Number Generator Coding
something like this perhaps:
VB Code:
Private Enum LEVEL
Poor = 3
Mediocre = 5
Good = 7
End Enum
Private Sub Form_Load()
Debug.Print GenRating(Good), GenRating(Good), GenRating(Good)
Debug.Print GenRating(Mediocre), GenRating(Mediocre), GenRating(Mediocre)
Debug.Print GenRating(Poor), GenRating(Poor), GenRating(Poor)
End Sub
Private Function GenRating(ByVal eLevel As LEVEL) As Long
GenRating = Int(Rnd * 3) + eLevel
End Function
-
Jul 10th, 2006, 01:45 PM
#4
Thread Starter
New Member
Re: Random Number Generator Coding
I have it sorted now. I described the function I wanted a reply to enable me to do. It wasn't that difficult to see. I am new to Visual Basic and was really wanting someone to use their expertise to help me, looks as if nobody is interested so I am going to do it myself and as I hit problems post them here.
-
Jul 10th, 2006, 01:53 PM
#5
Re: Random Number Generator Coding
Hmmm... I'm sorry if I offended you, that wasn't my intention I just didn't understand what you wanted to do. Bushmobile however seems to have understood it and did give you a reply.
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
|