Thread: progress bar
View Single Post
  #3 (permalink)  
Old September 21st, 2004, 07:07 PM
mat41 mat41 is offline
Friend of Wrox
Points: 5,604, Level: 31
Points: 5,604, Level: 31 Points: 5,604, Level: 31 Points: 5,604, Level: 31
Activity: 40%
Activity: 40% Activity: 40% Activity: 40%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,666
Thanks: 6
Thanked 9 Times in 9 Posts
Send a message via AIM to mat41
Default

I will try and find the personsname who should recieve the credits from this, i did not create it. he following is cut n paste code

-----------------------start------
<%
    Response.Buffer = False
    Server.scriptTimeout = 250000
    iProcessedSoFar = 0
    iTotalRecords = 10000
%>
<HTML>
<HEAD>
    <STYLE>
        BODY { background-color:#FFFFFF; font-family:verdana; }
        #progressBar { font-size:8pt; font:bold; border-style:solid; border-width:1px; border-color:#888888; padding:1px; text-align:center; }
        #progbar { height:6px; }
    </STYLE>
</HEAD>

<BODY>

    <TABLE WIDTH='100%' HEIGHT='100%'>
    <TR>
        <TD ALIGN='middle' VALIGN='center'>
        <SPAN ID='progressBar' STYLE='width:350px;'>
            <TABLE STYLE='color:red;' CELLPADDING='0' CELLSPACING='0' BORDER='0'>
            <TR>
                <TD ID='progbar' BGCOLOR='red'></TD>
            </TR>
            </TABLE>
        </SPAN>
        </TD>
    </TR>
    </TABLE>
    <script language="Javascript">var progBarWidth=350</script>
<%
for i = 0 to iTotalRecords
    iProcessedSoFar = iProcessedSoFar + 1
    pctComplete = (iProcessedSoFar/iTotalRecords)
    ShowProgress 2, i, pctComplete
next
FinishProgress

Sub ShowProgress(frequency, i, nPctComplete)
    if i mod frequency = 0 then
        nPctComplete = Replace(CStr(nPctComplete), ",", ".")
        Response.Write "<SCRIPT LANGUAGE='JavaScript'>progbar.style.width = Math.ceil(" & nPctComplete & " * progBarWidth);</SCRIPT>" & vbCrLf
    End If
End Sub

Sub FinishProgress
    Response.Write vbCrLf & "<SCRIPT LANGUAGE='JavaScript'>document.getElementById('pro gressBar').innerHTML = 'finished';</SCRIPT>"
End Sub
%>

</BODY>
</HTML>
-----------------------------end----------------


Wind is your friend
Matt
Reply With Quote