SetRandomRange
SetRandomRange

Sets the default range used when generating random numbers.

bSuccess = mySpecial.SetRandomRange( Min_Value, Range_Value )
bSuccess = mySpecial.SetRandomRange( Range_Value )

Return value
TRUE if successfull, otherwise FALSE.

Parameters
  • Min_Value
    The minimum value that can be returned (inclusive)
  • Range_Value
    The range of values that can be returned. i.e. The highest value can be calculated as the minimum value + the range (not inclusive)
Comments

By default, returned random values are between 0 (inclusive) and 100 (not incluisive)
Using Special:Random, you can provide these parimiters when you want them, however, GetNext does not have options for this (making it slightly faster)
Note that only integers are returned. You must manipulate the returned values if you want floats. However, the minimum and range are stored as floats, so the rounding may be effected by that.

See also
Special:GetRandomRange
Special:GetRandomMax
Special:GetRandomMin



JAM © 2005 no one in partiular
Project started by David Evans in 2005