Jump to content


Photo

Show running result of array creation


  • Please log in to reply
3 replies to this topic

#1 paruby

paruby
  • Members
  • PipPipPip
  • Advanced Member
  • 48 posts

Posted 02 March 2006 - 10:51 PM

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

#2 wickning1

wickning1
  • Members
  • PipPipPip
  • Advanced Member
  • 405 posts

Posted 03 March 2006 - 01:14 AM

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.

#3 paruby

paruby
  • Members
  • PipPipPip
  • Advanced Member
  • 48 posts

Posted 03 March 2006 - 02:25 AM

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...

#4 wickning1

wickning1
  • Members
  • PipPipPip
  • Advanced Member
  • 405 posts

Posted 03 March 2006 - 06:05 AM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users