home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 8,973 of 10,840   
   Sparky AKA_Sparkticus to Rick Rothstein   
   Re: random numbers help needed   
   12 Nov 04 17:14:44   
   
   From: Antispam_wanw34397_2@blueyonder.co.uk   
      
   Rick Rothstein wrote:   
   >> Hi I am trying to create two random numbers   
   >>   
   >> LBlnum1.Caption = Int(12 * Rnd) + 1   
   >> Lblnum2.Caption = Int(12 * Rnd) + 1   
   >>   
   >> This creates the numbers but they are always the same numbers.   
   >> example I get 9 & 7  then 7 & 4 then 10 & 1   
   >>   
   >> is their a way to make these numbers more random ?   
   >   
   > Execute the Randomize statement (only one time) somewhere inside your   
   > program before using the Rnd function. The best place to execute the   
   > Randomize function is in the Form_Load event (or Sub Main if you start   
   > your programs that way).   
   >   
   > Rick - MVP   
      
   Cheers worked great.....   
      
   Sparky   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca