Web >> Development >> ASP >> How to do response buffering and flushing

VBSCRIPT ASP example :- ----------------------- <%@ LANGUAGE="VBScript"%> <% Response.Buffer = True %> <HTML> <BODY> Start... <% iStart = 0 iEnd = 1000000 iInterval = 50000 for i=iStart to iEnd if ( (i Mod iInterval) = 0 ) then Response.Write "<table border=""1"" width=""100%""><tr><td width=""50%"">" & i & "</td><td width=""50%"">flushed</td></tr></table>" Response.Flush end if next %> </body></html> PERLSCRIPT ASP example :- -------------------------- <%@ LANGUAGE=PERLSCRIPT %> <% $Response->{Buffer} = 0; %> <body> <% $istart = 0; $iend = 2500000; $iintvl = 100000; for ($i=$istart;$i<$iend;$i ) { if ( ($i % $iintvl ) == ($iintvl-1) ) { my $line = sprintf "counter = %d remainder = %d\n", $i, ($i % $iintvl); $Response->write( qq(<table border='1' width='100%'><tr><td width='50%'>$i</td><td width='50%'>$line</td></tr></table>) ); $Response->Flush(); } #else #{ # $Response->write("other\n"); #} } %> </body> </html>