Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Generating a random number
I am a newbie to VB and have recently installed VB6. I used to do a little BASIC on my Commodore 64 but obviously that was quite some time ago! On that machine however it was easy to generate a random number, say between 0 and 10, with a simple line of code (though I can't remember what that was).
What I am looking to do is generate a genuinely random number, say between 0 and 10. How would I make 'a' for instance, have a random value between 0 and 10?
I have found the 'rnd' command but have read that the number generated would be repeated and so you use 'randomise' but to be honest I didn't really understand what it was all about. All I am looking to do is assign a genuine randomly generated value to 'a' for instance. Can you help me?
Your assistance would be appreciated.