<%
If Request.Form("process") <> "true" Then
Dim vCheck1, vCheck2, vCheck3, vLength
Dim vRand1, vRand2, vRand3
' Get the length of the secret word
vLength = Len(rsPersonnel("PrivateWord"))
' Randomly choose a character
Randomize
vRand1 = Int(rnd*vLength)+1
' Make sure we don't get the same character twice
Do
vRand2 = Int(rnd*vLength)+1
Loop While vRand2 = vRand1
' Make sure we don't get the same character thrice
Do
vRand3 = Int(rnd*vLength)+1
Loop While vRand3 = vRand1 Or vRand3 = vRand2
' Sort the characters into order, lowest to highest, for each dropdown
If (vRand1>vRand2 And vRand1>vRand3) Then vCheck1 = vRand1
ElseIf (vRand1>vRand2 And vRand1<vRand3) Then vCheck2 = vRand1
ElseIf (vRand1>vRand3 And vRand1<vRand2) Then vCheck2 = vRand1
ElseIf (vRand1<vRand2 And vRand1<vRand3) Then vCheck1 = vRand1
End If
If (vRand2>vRand1 And vRand2>vRand3) Then vCheck2 = vRand2
ElseIf (vRand2>vRand1 And vRand2<vRand3) Then vCheck2 = vRand2
ElseIf (vRand2>vRand3 And vRand2<vRand1) Then vCheck2 = vRand2
ElseIf (vRand2<vRand1 And vRand2<vRand3) Then vCheck1 = vRand2
End If
If (vRand3>vRand1 And vRand3>vRand2) Then vCheck3 = vRand3
ElseIf (vRand3>vRand1 And vRand3<vRand2) Then vCheck2 = vRand3
ElseIf (vRand3>vRand2 And vRand3<vRand1) Then vCheck2 = vRand3
ElseIf (vRand3<vRand1 And vRand3<vRand2) Then vCheck1 = vRand3
End If
End If
%>
<%
Sub sPopulateDropdown(vStart, vEnd)
' Dynamically populate a dropdown field
Dim i, sWrite
For i = vStart to vEnd
sWrite = "<option value=" & Chr(34) & Chr(i) & Chr(34) & ">" & Chr(i) & "</option>"
Response.Write sWrite
Next
End Sub
%> |