We have a Presentation Template that does a good amount of processing and it's called as a CGI task with a workflow that's executed on tt_data. So, basically, it appears as an all-in-one operation, although there are subcomponents.
The PT / CGI task may take up to 10 seconds or so to complete -- which is a long time if you're looking at a page to load. To address this, we have a message that appears as the user waits, "GENERATING PAGES... PLEASE WAIT". Thoughtful, right? Well, to accomplish this thoughtful display, we "had" to flush the buffer with some rather crappy, brute-force method. I'm wondering if there's a better way.
Here is the code:
...
print <<END;
Content-type: text/html
<html>
<title>DCR SAVE</title>
<body>
<br><br><center><font size=+1 face=Arial color='blue'><b>GENERATING PAGES...Do not close window until done.</font></center><br>
END
### Kluge to force buffer to flush
for ($i=0; $i<200; $i++)
{
print " ";
}
If the print statement is commented out, the text above does not actually display until the last 2 microseconds, which pretty well defeats the purpose.
Has anyone encountered this before and is there a cleaner way to do this? I've tried a few things so far, but to no avail.
Dave
Current Environment(s):
(1) TS 6.1 SP1 on W2K3
(2) TS 6.1 SP1 on W2K
(3) TS 5.5.2 SP2 on Win2K