INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

How to apply progressive bar on SQL-Select

RE: How to apply progressive bar on SQL-Select

If you look at the FAQs for this forum, you will see at least six articles which describe various ways of doing progress bars. You might start with FAQ184-5535: A Progress Bar or Thermometer Class. If that doesn't meet your needs, search the FAQ content page for others.

A couple of points. The usual name is "progress bar", not "progressive bar". Keep that in mind when searching. They are sometimes also called a "thermometer". Personally I don't like that name because it has nothing to do with measuring temperature, but you will still see it from time to time.

Finally, as we explained in your other thread, a progress bar does not speed up a query. I think you understood that. But keep in mind too that it can slightly slow down a query, because updating the screen is a relatively slow operation.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: How to apply progressive bar on SQL-Select

Just to add another point. A well-designed progress bar can look very nice and will serve its purpose well. But if you want a particularly easy way of keeping the user informed of progress, a plain ordinary WAIT WINDOW .... NOWAIT will also do the job.

For example, if you want to show the progress through a loop, you could do something like this:

CODE -->

SELECT MyTable
SCAN

  * Do your processing here

  WAIT WINDOW TRANS(ROUND((RECNO() / RECCOUNT()) * 100)) + " % " NOWAIT

ENDSCAN 

It won't look very elegant, but it will serve its purpose.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: How to apply progressive bar on SQL-Select

(OP)
Thanks

WAIT WINDOW TRANSFORM(ROUND((RECNO() / RECCOUNT()) * 100)) + "%" NOWAIT

Error is showing 'Too Few Arguments"

Saif

RE: How to apply progressive bar on SQL-Select

OK, that's my mistake. It should be like this:

CODE -->

WAIT WINDOW TRANSFORM(ROUND((RECNO() / RECCOUNT()), 0) * 100)) + "%" NOWAIT 

But, you know, a quick glance would have told you the same.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: How to apply progressive bar on SQL-Select

(OP)
Still showing error

See


RE: How to apply progressive bar on SQL-Select

Saif, really, you should be able to work this one out for yourself. You must know that for every opening paren you need a matching closing paren. Just study the code and it should be obvious.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: How to apply progressive bar on SQL-Select

This version should work:

CODE -->

WAIT WINDOW TRANSFORM(ROUND((RECNO() / RECCOUNT()) * 100, 0)) + "%" NOWAIT 

This was my mistake, but the aim was to show you what was possible, not to deal with every minor point of syntax.

Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: How to apply progressive bar on SQL-Select

(OP)
Thanks and sorry !!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close