Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to apply progressive bar on SQL-Select

Status
Not open for further replies.

alisaif

ISP
Apr 6, 2013
418
0
0
AE
Hi,

Please refer to my previous thread thread184-1781999

Kindly let me know how to use progressive bar for the same.

Thanks

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

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

Error is showing 'Too Few Arguments"

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

Code:
WAIT WINDOW TRANSFORM(ROUND((RECNO() / RECCOUNT())[b], 0[/b]) * 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
 
Still showing error

See

waiterr1_li4fs9.png
 
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
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top