Jump to content

Archived

This topic is now archived and is closed to further replies.

paruby

Show running result of array creation

Recommended Posts

I am creating an array from data from a mssql SELECT statement. I have a total of 530 rows of data returned that I am then inserting into an array. I want the screen to update the number of rows added to the array, so it loks like an rolling update, ie. print: "1 of 530 rows added"; then print: "2 of 530 rows added"... print "530 of 530 rows added". But I want it to "overwrite" the previous line so it looks like the fisrt number is changing... Seems easy, but can it be done?

Thanx
Pete

Share this post


Link to post
Share on other sites
Is this a web page or a command line script? You can't do that with a web page. On the command line you may be able to use fseek() and fwrite() on STDOUT. I've never tried it though. Make sure it's automatically flushing output.

You can also try clearing the screen with a system command just before a write.

Share this post


Link to post
Share on other sites
Thank you for the reply. i am trying to do this on a web page, so I guess te answer is no. At least I know...

Share this post


Link to post
Share on other sites
If it's a really long process, you probably don't want to make your user(s) wait. You should be able to send them to an intermediate page while they wait, one with an animated gif or something, and set it to redirect to a "completed" page after a period of time.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.