CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2010
    Posts
    22

    Radome number geerating please

    I call randomize function before rangom() but I do'n't get the random everytime I run the program. Why is it all the same numbers every run


    ??

    Also I run my program in one computer and I got numbers but on another I got different ones
    How can I make my randomize returns the same numbsers on all machine I want to run because my situation doesn;t allow differences

    Thank you

    (Give me nice numbers please I want to choose it for later and tonight runs)

  2. #2
    Join Date
    Jan 2010
    Posts
    22

    Re: Radome number geerating please


  3. #3
    Join Date
    Oct 2006
    Posts
    327

    Re: Radome number geerating please

    Hello,

    How can I make my randomize returns the same numbsers on all machine I want to run because my situation doesn;t allow differences
    huh....
    How would that be ? Random or not Random ? that's the new existencial question

  4. #4
    Join Date
    Jan 2010
    Posts
    22

    Re: Radome number geerating please

    Your replies really get me focused. Im unabe to keep my self away from them. really headache \\(_._)//

  5. #5
    Join Date
    Oct 2006
    Posts
    327

    Re: Radome number geerating please

    Well,
    What about explaining in details the situation. I mean everything ... so that we can see what you are exactly looking for ?
    It could also be a good idea to show us what you have already written (with comments)

  6. #6
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,725

    Re: Radome number geerating please

    After my experience the sequence of random numbers is the same on Win XP and NT operating systems. I don't know about Vista or Win7.
    A VB program creating random numbers wil produce the same sequence of random numbers on any computer.
    Because people don't want that - because random is actually not meant to be predictable - there is the Randomize statement in VB which takes the time of day as a seed to create the random sequence, so it is never ever the same.

    So if you want the same sequence everytime you start the program you only have to not use the Randomize statement and you get the same sequence - for my experience on any other computer, too.

  7. #7
    Join Date
    Apr 2009
    Posts
    394

    Re: Radome number geerating please

    VB's Rnd function is designed to produce a sequence of numbers that seem random but are not and this is by design for debugging purposes. Meaning, if you create a list from sequential calls to a Rnd function, you will notice that eventually it starts repeating. Once again this is by design for debugging purposes. Then the use of the Randomize statement turns this default behavior off, but repeated calls to the Randomize statement "resets" the random behavior and can defeat it original purpose.

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

Featured