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:
00459307
Views:
20
>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.

>
>#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
>
Hello, Simon.

The concept is interesting, but I don't understand why you're always showing 100% at the end. Also, you are not making the percentage proportional with the bar length.

Something I did in my progress bars that facilitates it's use, too, is to pass the function the current position and the total, then I calculate the lenght of the bar. Having to pass the percentage already calculated foces you to do it in every place where you are calling the component.

Good luck.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform