Results 1 to 6 of 6

Thread: Random number generator

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    5

    Random number generator

    my first project i post here

    was created using VS 2010

    waiting for any comments

    thank you
    Attached Files Attached Files
    Last edited by fido77777; Sep 1st, 2010 at 08:18 PM.

  2. #2
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: Random number generator

    1. I suggest you remove the EXE files from the /bin and /obj folders, as it's against the rules to leave them in there...

    2. What's with the "Count out of Range"?

    3. You misspelled "Generate".

    4. I suggest you use OrElse instead of Or, remove = True, don't define your variables at class-level, don't use a typeless array, remove the ElseIf and replace it with Else.

    5. DON'T USE GOTO!
    Last edited by minitech; Sep 1st, 2010 at 06:45 PM.

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    5

    Re: Random number generator

    1-
    2- if you put 1 as start and 10 as end you can get only 10 unique random numbers within that range so you can't ask for more than that in the count box
    3-
    4-
    5- how can the code work without the GOTO statment ? i ask for help here

    thank you for your time for reviewing my code and your suggestions are very helpful

  4. #4
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: Random number generator

    Oh, thanks I didn't notice that they were unique!

    Here's a code sample that uses a List(Of t) instead, and a few other minor adjustments, too.
    Attached Files Attached Files

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    5

    Re: Random number generator

    thank you for your very great help

    if i try to create random numbers greater than thousands it slows down the computer and makes it hang sometimes that is why i limited it to 1000 which i think it is more than anyone can need
    to step forward we need to learn ... and we learn from our mistakes

  6. #6
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: Random number generator

    Ah, okay...

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