Results 1 to 21 of 21

Thread: Here's a better way to generate random nums than using Rnd

Threaded View

  1. #5

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2008
    Posts
    1,238

    Re: Here's a better way to generate random nums than using Rnd

    Quote Originally Posted by Steve Grant View Post
    Well as you are expert/arrogant enough to be able to tell me 'I must be doing something wrong!' Perhaps you can tell me what is wrong with this scenario;

    Directly copy all code from post #1, paste into VB6 Pro SP6 on 64bit Win 10 Home. Change forms AutoRedraw to true then run programme.

    There is a very brief flash and then the programme quits. Re-run the programme checking the value of hProv, it is ZERO therefore triggers the unload event!!!
    I just started a new instance of VB6, copied the code into it, and ran it. It worked as expected. I do not know what you did, but it clearly is making the program not work. Try copying the code again, and make sure you get every line of code, so that you know you didn't accidentally miss a line of code when copying it. Start a new instance of VB6, paste it into the Form1 code section, and set the form's AutoRedraw property to true. Then run the program.

    If it still does not work for you, copy the entirety of your form's code, and paste it in a reply to this thread, and I will see what (if anything) is wrong with your copy of the code.

    Also, I have included a compiled EXE copy of this program in this post. It is in the ZIP file RandomTest.zip which I have attached to this post. Try running the EXE version on your computer. It may be that your copy of VB6 isn't compiling or interpreting correctly, so I have included this, just in case that's what's happening.
    Last edited by Shaggy Hiker; Mar 16th, 2017 at 12:04 PM. Reason: Removed attachment, with regret.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width