hwg-languages archives | Apr 2000 | new search | results | previous | next |
Re: vbscriptby gflowers(at)micron.net |
|
This will return a number between 1 and 10. <% Randomize rndNum = Int((10 - 1 + 1) * Rnd + 1) %> ----- Original Message ----- From: "McKinley Bradley Floyd Jr." <mfloyd(at)idworld.net> Date: Thursday, April 27, 2000 11:09 pm Subject: vbscript > hello...I need help...I am trying to use the randomizer function > in vbscript > and I need an example on how to use the code. there seems to be > differentparts to this statement. the code i have is below > > Can someone please explain to me how to use this code: > > Do I need to create a text box? what? I'm confused > > please help...Mack > > > <% = Tools.Random %> > <% = ( Abs( Tools.Random ) ) %> > <% = ( Abs( Tools.Random ) ) Mod 100 %> > > > > <% > Dim MyValue, Response > Randomize ' Initialize random-number generator. > > Do Until Response = vbNo > MyValue = Int((6 * Rnd) + 1) ' Generate random value between 1 > and 6. > MsgBox MyValue > Response = MsgBox ("Roll again? ", vbYesNo) > Loop > %> > > Rnd[(number)] > > Int((upperbound - lowerbound + 1) * Rnd + lowerbound) > > >
HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA