borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Combobox)Next Topic (Reading Sound File!!!) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Random Number Generator.
Poster Message
seang_sophorn
Level: Big Cheese

Registered: 07-06-2005
Posts: 26

icon Random Number Generator.

hi all,

Can anyone help me, How to create number from 1 to 10?

I use that:
txt1=int(10 * Rnd()) //Create a random number between 1 to 10

but it also display zero (0) sometime. I d't want zero, how?

____________________________
need for your help

25-05-2007 at 09:36 AM
View Profile Send Email to User Show All Posts | Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: Random Number Generator.

txt1=int(9 * Rnd() + 1)



[Edited by yronium on 25-05-2007 at 06:25 PM GMT]

____________________________
Real Programmer can count up to 1024 on his fingers

25-05-2007 at 05:24 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : Random Number Generator.
Previous Topic (Combobox)Next Topic (Reading Sound File!!!) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder