Hello, I need to add people's name multiple times to pick one of them at random using the Random Number Function in VBScript. I know how to use it using only each person's name one time but how can I add each person multiple times so that they have a better chance of being picked by the Random Number Function? Below is my code so far which works great but each person is only added one time right now.
Code:
<%
Option Explicit
Response.Buffer = True
'For browsers (set expiration date some time well in the past)
Response.Expires = -1000
'For HTTP/1.1 based proxy servers
Response.CacheControl = "no-cache"
'For HTTP/1.0 based proxy servers
Response.AddHeader "Pragma", "no-cache"
Dim Hat(10)
Hat(1) = "Ace"
Hat(2) = "Charles"
Hat(3) = "Johnny"
Hat(4) = "Julie"
Hat(5) = "Debbe"
Hat(6) = "Thuan"
Hat(7) = "Gary"
Hat(8) = "Lisa"
Hat(9) = "Eva"
Hat(10) = "Ramona"
Function RandomNumber(intHighestNumber)
Randomize
RandomNumber = Int(intHighestNumber * Rnd) + 1
End Function
Dim strRandomHat
strRandomHat = Hat(RandomNumber(10))
%>
<html>
<head>
<title>Random Telecommute Drawing</title>
</head>
<body>
<div style="border:thin solid black;margin:1em;
padding:1em;height:100px;width:100%">
<center><h1>Winner of the Random Telecommute Day is... </h1>
<p><%= strRandomHat %><p></center>
</div>
<br />
<form name="frmNewHat">
<center><input type="hidden" name="cmdNewHat" value="Random Selection"
onClick="window.open(document.location.href,'_top');" /></center>
</form>
</body>
<center>
<FORM>
<INPUT TYPE="BUTTON" VALUE="Back" ONCLICK="window.location.href='../cssopt/home.asp'">
</FORM>
</center>
</html>
<% Response.End %>