<% 'Some before doings... 'Lets get the current poll... Dim sTitle Dim sQuestion Dim vAnswers(8) Dim vCount(8), sID sID = Request.QueryString("id") If sID = "" Then sID = -1 End If Dim sError 'Are we trying to vote? If Request.Form("R1") <> "" Then 'First try to vote... sError = PollMentor_TryToVote(sID,Request.Form("R1") ) End If 'Get active one... Dim nRet nRet = PollMentor_GetPollInfo( sID, sTitle, sQuestion, vAnswers, vCount ) %> Enquete
<%=sError%>
<%=sQuestion%>
<% Dim nCount, nMaxValue, nLowValue 'First of all get max value and nLowValue nMaxValue = 0 For nCount=1 To 8 If vAnswers(nCount)<>"" And vCount(nCount)>nMaxValue Then nMaxValue = vCount(nCount) End If Next If nMaxValue = 0 Then nMaxValue = 1 End If Dim nMaxWidth nMaxWidth = 120 'This is number of pixels for maxvalue Dim nThisVal, nTotal, nPercent nTotal = 0 nPercent = 0 For nCount=1 To 8 If vAnswers(nCount)<>"" Then nTotal = nTotal + vCount(nCount) nThisVal = FormatNumber(vCount(nCount)/nMaxValue * nMaxWidth,0) nPercent = VCount(nCount) 'nPercent = ((nThisVal/120) / nTotal)*100 'nPercent = FormatPercent(vCount(nCount)/nTotal)*100,0 %>
<%=vAnswers(nCount)%>
  <%=nPercent%>
<% End If Next %>
Total de votos: <%=nTotal%>