A class written by a foreigner, such a small application is not necessary to be modular unless there are special needs.
Use asp to generate a random number.
<%
''**************************************************************************
''CLASS:cRandom
''Callsrandomizetoseedtherdomnumbergenerator.
''Provides functions for returnrangedrandomintegersorarraysof
''rangedrandomintegers.
''Callingrandomizetoseedtherandomnumbergeneratoratthetimethe
''classified seems like areasonablethingtodo.
privatesubClass_Initialize()
''ChecktheVBScriptdocumentationforthespecificsrelating
''totheRandomizefunction
Randomize
endsub
''Terminated doesn''tneedtodo anything forthisclass
privatesubClass_Terminate()
endsub
''***************************************************************************************************
''FUNCTION:RangedRandom
''PARAMETER: lowerBound, thelowestallowablenumbertoreturn
''PARAMETER: upperBound, the highestallowablenumbertoreturn
''RETURNS:ArandomintegerbetweenlowerBound and UpperBound,
''inclusive
''***************************************************************************************************
publicfunctionRangedRandom(lowerBound, upperBound)
RangedRandom=CInt((upperBound-lowerBound)*Rnd+lowerBound)
endfunction
''***************************************************************************************************
''FUNCTION:RangedRandomArray
''PARAMETER: lowerBound, thelowestallowablenumbertoreturn
''PARAMETER: upperBound, the highestallowablenumbertoreturn
''PARAMETER: arraySize,zerobased number specifying thesize of thearray
''PARAMETER:duplicates,trueorfalsetoindicate whetherduplicate
''resizethetempArraytoholdthenumberoferomeelementspassedinthe
''arraySizeparameter
redimtempArray(arraySize)
''Thisisasaloopcounter,setitto0
filledElements=0