Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A Simple Fast Progress Bar
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00459173
Message ID:
00459252
Views:
22
Hi!

There is popular approach described below:

Define a simple form with rectangular shapes on it that will show progress. Define a public program that will be called in the 'FOR' clause of each command that requires progress bar, for example:

copy to ... FOR Progress()

Routine should always return .T. with only exception when user hits ESC key. In the Progress routine check for ESC key using INKEY() function. If it is pressede - go to bottom of current cursor to force finish of working. Otherwise - update progress bar accordingly to current record and number of total records.


>Hi
>
>Just for interest I created the following simple progress bar. I use it in my applications because I wanted something that was fast. I have used objects with Colored shapes that increase in size etc. but this is simple and available
>to all my objects.
>
>I even use it with "Append from" and "Copy To" commands to show the progress of time consuming operations. You suffer a performance hit in these commands but at least the user knows things are working.
>
>
>#Define DC_PROGRESSBARLENGTH    75
>
>Procedure ShowProgress
>LParameter lcMsgTxt,;
>           lnPercent
>
>Local lnCurrentBarLen
>lnCurrentBarLen=Int(DC_PROGRESSBARLENGTH*Min(1,lnPercent))
>
>Set Message To "  Progress:"+Replicate(DC_PROGRESSBARCHARACTER,lnCurrentBarLen)+;
>Replicate(" ",DC_PROGRESSBARLENGTH-lnCurrentBarLen)+"100%      "+lcMsgTxt
>Return
>
>
>Simon
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform