response.buffer=true
\’ 应用缓存技术.
dim lostnum
\’ 防止dmax过大而dstep过小.
dim shownum
delayshow(dstep,dmax)
sub delayshow(dstep,dmax)
\’ dmax表示要处理多少dmax(步)才能完成全过程,dstep表示已处理的占全过程的大致百分比.
dim total
\’ 显示所有画面.
dim dtemp
\’ 过渡变量.
total=100
dtemp=dstep
dstep=dstep+lostnum
if (dstep*total)/dmax<1 then
\’ 当画面连1%都没有时,则不画,同时用变量lostnum存放未画的总数,便于下次调用本过程时继续.
lostnum=lostnum+dtemp
else
for ccc=1 to fix((dstep*total)/dmax)
\’ 取整数.
Response.Flush
shownum=shownum+fix((dstep*total)/dmax)
lostnum=0
\’ 显示缓存里的图片,变量shownum用于存放目前已画的图片.
end if
end sub
sub showlost()
for ccc=1 to (100-shownum)
Response.Write (\”<img src=\”\”suifengqiwu/images/delay1.jpg\”\”>\”)
\’ 如果取余造成不能画完100次,由showlost()将余下未画的显示为已处理.
next
Response.Write \”<BR>\”
Response.Flush
end sub