RE: Displaying a status bar
Should've known there's always a correct way. I was just adding the increments without realizing the percentage bar numbers. Took your advice and used setPercent() and removed the sleep(), and left buffering on. Works great. Thanks again, David -Original Message- From: Thomas, Mark - BLS CTR [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 12:13 PM To: 'Hsu, David'; Thomas, Mark - BLS CTR; [EMAIL PROTECTED] Cc: 'Lee Goddard' Subject: RE: Displaying a status bar > Mark, > I set buffering to off ($| = 0) just before saving Excel > Workook, it seems to do what I want it to do. Even Though > I'm not setting the status bar to 100, it seems to disappear > smoothly when the processing is done. Coincidence. It happens to go over 100 near the end of your loop, and thus automatically disappears. > BTW, here is how I am > looping to increment the status bar. > > $n=0; > While ($i) # $i = 7 > { > ... > $n = $n + 4 # I had to play with this number to make > it work, finally 4 seems to increment well. > print "increment($n)"; > } Iteration 1: increment(4), bar at 4% Iteration 2: increment(8), bar at 12% Iteration 3: increment(12), bar at 24% Iteration 4: increment(16), bar at 40% Iteration 5: increment(20), bar at 60% Iteration 6: increment(24), bar at 84% Iteration 7: increment(28), bar at 112% (disappears) This is what you're doing. Is it really what you want? You'd probably be better off using setPercent($p) where $p = 100/$maxsteps * $iteration > ... > $| = 0; > 501 $Workbook->SaveAs($path); > 502 $Workbook->Close(); > 503 $Excel->Quit(); > 504 sleep(1); > 505 print h2("Query Completed"); > 506 print $r->end_html; > > Mark, thanks for your help and the status bar script. > > Lee, thanks for you suggestion, I did use sleep just to delay > a sec. for the bar to disappear, before printing. This is unnecessary. If the half-second delay after passing 100% is too long, you can send "hidebar()" to hide it immediately. -- Mark Thomas[EMAIL PROTECTED] Internet Systems Architect User Technology Associates, Inc. $_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;; ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Displaying a status bar
> Mark, > I set buffering to off ($| = 0) just before saving Excel > Workook, it seems to do what I want it to do. Even though > I'm not setting the status bar to 100, it seems to disappear > smoothly when the processing is done. Coincidence. It happens to go over 100 near the end of your loop, and thus automatically disappears. > BTW, here is how I am > looping to increment the status bar. > > $n=0; > While ($i) # $i = 7 > { > ... > $n = $n + 4 # I had to play with this number to make > it work, finally 4 seems to increment well. > print "increment($n)"; > } Iteration 1: increment(4), bar at 4% Iteration 2: increment(8), bar at 12% Iteration 3: increment(12), bar at 24% Iteration 4: increment(16), bar at 40% Iteration 5: increment(20), bar at 60% Iteration 6: increment(24), bar at 84% Iteration 7: increment(28), bar at 112% (disappears) This is what you're doing. Is it really what you want? You'd probably be better off using setPercent($p) where $p = 100/$maxsteps * $iteration > ... > $| = 0; > 501 $Workbook->SaveAs($path); > 502 $Workbook->Close(); > 503 $Excel->Quit(); > 504 sleep(1); > 505 print h2("Query Completed"); > 506 print $r->end_html; > > Mark, thanks for your help and the status bar script. > > Lee, thanks for you suggestion, I did use sleep just to delay > a sec. for the bar to disappear, before printing. This is unnecessary. If the half-second delay after passing 100% is too long, you can send "hidebar()" to hide it immediately. -- Mark Thomas[EMAIL PROTECTED] Internet Systems Architect User Technology Associates, Inc. $_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;; ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Displaying a status bar
Mark, I set buffering to off ($| = 0) just before saving Excel Workook, it seems to do what I want it to do. Even though I'm not setting the status bar to 100, it seems to disappear smoothly when the processing is done. BTW, here is how I am looping to increment the status bar. $n=0; While ($i) # $i = 7 { ... $n = $n + 4 # I had to play with this number to make it work, finally 4 seems to increment well. print "increment($n)"; } ... $| = 0; 501 $Workbook->SaveAs($path); 502 $Workbook->Close(); 503 $Excel->Quit(); 504 sleep(1); 505 print h2("Query Completed"); 506 print $r->end_html; Mark, thanks for your help and the status bar script. Lee, thanks for you suggestion, I did use sleep just to delay a sec. for the bar to disappear, before printing. Regards, David -Original Message- From: Thomas, Mark - BLS CTR [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 3:01 PM To: 'Hsu, David'; Thomas, Mark - BLS CTR; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Displaying a status bar Hsu, David [mailto:[EMAIL PROTECTED] wrote: > Thanks Mark for the status bar. > It seems to work well and definitely what I want, but the > status bar is disappearing too soon, even though I am > controlling when to disappear. [...] > The thing is that once the status bar > disappears, I am still waiting (~ 45sec) before line 505 is > printed. I think it is still processing the Excel workbook > because the saved file has not appeared. > > Any ideas? How are you incrementing the progress bar? Perhaps it's getting to 100% before your setPercent(100) call, and automatically disappearing. Try removing the setPercent(100) and see if the bar still disappears. If that test shows that the bar remains on the page to the end, try putting the setPercent(100) in the body onload event, i.e. - Mark. -- Mark Thomas[EMAIL PROTECTED] Internet Systems Architect User Technology Associates, Inc. $_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;; > -Original Message- > From: Thomas, Mark - BLS CTR [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 25, 2003 2:23 PM > To: 'Hsu, David'; [EMAIL PROTECTED]; > [EMAIL PROTECTED] > Subject: RE: Displaying a status bar > > > > Hello, > > > > Can someone let me know of a method of displaying a status bar on > > screen(html) in Perl script while it is processing a task. I > > have tried to print html, but it won't display the image > > until it has finished processing, and then it displays with > > the rest of the information. > > Your problem may be output buffering. Put $|++; in your > program before sending any output and you can then print html > to the screen. > > That being said, I've created a javascript library that puts > a graphical status bar on the screen, and the percentage, > overlay text, and color can be set by a perl program as it > running, and at the end, it disappears so as not to interfere > with the output. It's useful for long-running programs. > Contact me off-list if you want it. > > - Mark. > > -- > Mark Thomas[EMAIL PROTECTED] > Internet Systems Architect User Technology Associates, Inc. > > $_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; > ;y;y; ;;print;; > > ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re[2]: Displaying a status bar
0002 $| = 1;... 5010 $Workbook->SaveAs($path); 5020 $Workbook->Close(); 5030 $Excel->Quit(); 5040 print "setPercent(100)"; 5050 print h2("Query Completed"); 5060 print $r->end_html; Sorry, I don't know the JavaScript you're talking about. But, What happens if you make like 5035 (above) read sleep(10); Does the bar pause? What's the $r object? CGI or mod_perl or something? Make sure you have whatever it is send the correct headers *before* anything else, and that the other HTML elements are "good", otherwise the browser may be doing unexpected things. -- Cheers Lee $$=qw$808273788400074285838400657879847269820080698276007265677569820727$; $$=~s$(\d\d)$\$_.=chr(\$1+32)$ge;eval; ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Displaying a status bar
Thanks Mark for the status bar. It seems to work well and definitely what I want, but the status bar is disappearing too soon, even though I am controlling when to disappear. I am not sure why it is skipping the other code and processing the code where I tell the status bar to disappear. Here is the last part of my code after all processing. I am querying all the data into Excel and saving it. $| = 1; ... ... 501 $Workbook->SaveAs($path); 502 $Workbook->Close(); 503 $Excel->Quit(); 504 print "setPercent(100)"; 505 print h2("Query Completed"); 506 print $r->end_html; I can put line 504 at the end (line 507) and it would still process it first. The thing is that once the status bar disappears, I am still waiting (~ 45sec) before line 505 is printed. I think it is still processing the Excel workbook because the saved file has not appeared. Any ideas? David -Original Message- From: Thomas, Mark - BLS CTR [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 2:23 PM To: 'Hsu, David'; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Displaying a status bar > Hello, > > Can someone let me know of a method of displaying a status bar on > screen(html) in Perl script while it is processing a task. I > have tried to print html, but it won't display the image > until it has finished processing, and then it displays with > the rest of the information. Your problem may be output buffering. Put $|++; in your program before sending any output and you can then print html to the screen. That being said, I've created a javascript library that puts a graphical status bar on the screen, and the percentage, overlay text, and color can be set by a perl program as it running, and at the end, it disappears so as not to interfere with the output. It's useful for long-running programs. Contact me off-list if you want it. - Mark. -- Mark Thomas[EMAIL PROTECTED] Internet Systems Architect User Technology Associates, Inc. $_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;; ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Displaying a status bar
Mark, Thanks for your suggestion. I set the output buffer to Off, and it is displaying my html status bar and it seems to be processing in the background. But, I want to display my results page after processing. It seems that the status page does not "go away" even after processing is done. I have added the print out of data after the processing steps in my code. My data sets are sometimes large and small. During the smaller data sets, the processed data would be displayed on the same page as the status bar. The larger data sets, it seems it would always stay on the status bar screen, without displaying any processed data. Any thoughts on this. Thanks, David -Original Message- From: Thomas, Mark - BLS CTR [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 25, 2003 2:23 PM To: 'Hsu, David'; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Displaying a status bar > Hello, > > Can someone let me know of a method of displaying a status bar on > screen(html) in Perl script while it is processing a task. I > have tried to print html, but it won't display the image > until it has finished processing, and then it displays with > the rest of the information. Your problem may be output buffering. Put $|++; in your program before sending any output and you can then print html to the screen. That being said, I've created a javascript library that puts a graphical status bar on the screen, and the percentage, overlay text, and color can be set by a perl program as it running, and at the end, it disappears so as not to interfere with the output. It's useful for long-running programs. Contact me off-list if you want it. - Mark. -- Mark Thomas[EMAIL PROTECTED] Internet Systems Architect User Technology Associates, Inc. $_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;; ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Displaying a status bar
> Hello, > > Can someone let me know of a method of displaying a status bar on > screen(html) in Perl script while it is processing a task. I > have tried to print html, but it won't display the image > until it has finished processing, and then it displays with > the rest of the information. Your problem may be output buffering. Put $|++; in your program before sending any output and you can then print html to the screen. That being said, I've created a javascript library that puts a graphical status bar on the screen, and the percentage, overlay text, and color can be set by a perl program as it running, and at the end, it disappears so as not to interfere with the output. It's useful for long-running programs. Contact me off-list if you want it. - Mark. -- Mark Thomas[EMAIL PROTECTED] Internet Systems Architect User Technology Associates, Inc. $_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;; ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Displaying a status bar
Title: RE: Displaying a status bar I don;t think there is really a way unless u use a flash front end to start the perl script running then take the output from the perl script and use that to make your determination... flash has some kewl content tools... =) -Original Message- From: Hsu, David [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 25, 2003 1:06 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Displaying a status bar Hello, Can someone let me know of a method of displaying a status bar on screen(html) in Perl script while it is processing a task. I have tried to print html, but it won't display the image until it has finished processing, and then it displays with the rest of the information. _javascript_ is an option, but if the status screen is selected into the background, it will never close. Thanks, David ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Displaying a status bar
Hello, Can someone let me know of a method of displaying a status bar on screen(html) in Perl script while it is processing a task. I have tried to print html, but it won't display the image until it has finished processing, and then it displays with the rest of the information. JavaScript is an option, but if the status screen is selected into the background, it will never close. Thanks, David ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs