Date:  12/26/2014 10:46:47 AM Msg ID:  004758
From:  FoxWeb Support Thread:  004757
Subject:  Re: ProgressBar
What are the problems you are referring to? You can't just paste some code and expect people to run it to determine the problem -- especially not when this code has dependencies on your own data tables, which makes it impossible to run. Please describe the exact nature of the problem and steps to reproduce. 
FoxWeb Support Team
support@foxweb.com email
Sent by yoon deokman on 12/26/2014 04:40:19 AM:
 Hi!
Could you help me with this problems?
 
<html>
<head>
<%
M.StartTime = SECONDS()
Response.Write('<style>' + CRLF + FILETOSTR('ProgressBar.css') + CRLF + '</style>' + CRLF)
Response.Write('<script language="JavaScript">' + FILETOSTR('ProgressBar.js') + CRLF + '</script>' + CRLF)
%>

<div id="progressOuterDiv"></div>
<script language="JavaScript">
var progressBar = new cProgressBar();
progressBar.init();
progressBar.show(true);
</script>
<%
M.TotalSteps = 30
FOR i = 1 TO M.TotalSteps
UpdateProgressBar(M.i / M.TotalSteps * 100, 'Completed step ' + Server.ToString(M.i) + ' of ' + Server.ToString(M.TotalSteps))
* Some time passes...
WAIT '' TIMEOUT .5
NEXT
%>
<script language="JavaScript">progressBar.show(false);</script>
<p align="left"><font face="Verdana"><span style="font-size:9pt;">Thanks for your patience</span></font></p>

</head>
<body>

<%
set date ansi
set excl off
set dele on

if !used("ydg")
sele 0
USE ydg
endif

IF request.FORMCOUNT()>0
M.STYPE=request.FORM('STYPE')
M.SKEY=request.FORM('SKEY')
endif

sele ydg
do case
case m.stype='1'
sele ydg
set filt to at(allt(upper(m.skey)),upper(name))>0
COUNT TO nVal
        M.MESSAGE="["+ALLTRIM(STR(nVal))+"] Results for ["+M.SKEY+"] in Name"
case m.stype='2'
sele ydg
set filt to at(allt(upper(m.skey)),upper(section))>0
COUNT TO nVal
        M.MESSAGE="["+ALLTRIM(STR(nVal))+"] Results for ["+M.SKEY+"] in Section"
endcase
%>
    <tr>
        <td width="379" align="center">
            <p align="right"><%=m.message%></p>
        </td>
    </tr>

<TABLE cellSpacing=0 borderColorDark=white cellPadding=2 width="120" 
<borderColorLight=silver align="center" style="border-collapse:collapse;" height="18">
<TBODY>
   <TR>
        <td> Dept_no </td> 
        <td> Section </td>  
   </TR> 
<%
sele ydg
go top
scan WHILE !EOF()
if Lenc(allt(ydg.depart_no)) > 100 then
v_depart_no= Leftc(depart_no,100) + "..."
else 
v_depart_no= allt(ydg.depart_no)
endif
  M.REC_NO=ALLT(STR(RECNO()))
%>                                
   <TR>
        <td><%=Dept_no%></td> 
        <td><%=section%></td>  
   </TR> 
      
<%
  endscan
%>
</table>

<%
PROCEDURE UpdateProgressBar
LPARAMETERS PercentComplete, StatusText
IF (SECONDS() - StartTime) + 5 >= Server.ScriptTimeout
Server.AddScriptTimeout(10)
ENDIF

IF TYPE('M.StatusText') <> 'C'
Response.Write([<script language="JavaScript">progressBar.update(] + Server.ToString(M.PercentComplete) + [);</script>] + CRLF)
ELSE
Response.Write([<script language="JavaScript">progressBar.update(] + Server.ToString(M.PercentComplete) + [, '] + M.StatusText + [');</script>] + CRLF)
ENDIF
Response.Flush
ENDPROC
%>
</body>
</html>
 
Thank you very much