response.buffer=true
' 應(yīng)用緩存技術(shù).
dim lostnum
' 防止dmax過(guò)大而dstep過(guò)小.
dim shownum
delayshow(dstep,dmax)
sub delayshow(dstep,dmax)
' dmax表示要處理多少dmax(步)才能完成全過(guò)程,dstep表示已處理的占全過(guò)程的大致百分比.
dim total
' 顯示所有畫(huà)面.
dim dtemp
' 過(guò)渡變量.
total=100
dtemp=dstep
dstep=dstep+lostnum
if (dstep*total)/dmax<1 then
' 當(dāng)畫(huà)面連1%都沒(méi)有時(shí),則不畫(huà),同時(shí)用變量lostnum存放未畫(huà)的總數(shù),便于下次調(diào)用本過(guò)程時(shí)繼續(xù).
lostnum=lostnum+dtemp
else
for ccc=1 tofix((dstep*total)/dmax)
' 取整數(shù).
Response.Flush
shownum=shownum+fix((dstep*total)/dmax)
lostnum=0
' 顯示緩存里的圖片,變量shownum用于存放目前已畫(huà)的圖片.
end if
end sub
sub showlost()
for ccc=1 to (100-shownum)
Response.Write ("<img src=""suifengqiwu/images/delay1.jpg"">")
' 如果取余造成不能畫(huà)完100次,由showlost()將余下未畫(huà)的顯示為已處理.
next
Response.Write "<BR>"
Response.Flush
end sub
更多信息請(qǐng)查看IT技術(shù)專(zhuān)欄