VFP: Progress bar

VFP Progress bar using foundation class

Using the foundation class you can have a progress bar in no time. Hardest part is to locate the FFC folder, but most of the times it’s just beneath the vfp install program folder found with SYS(2004).

Half this code is for slowing down the demo:

* Progressbar with VFP Foundation Classes
* Source: https://degraafonline.com
* Free after Carl Warner's article at http://www.vfug.org/Newsletters/ThermometerBar.htm 

 lnPause = 2 && seconds between steps
 lcLibraryLocation = SYS(2004)+[FFC\]
 loTherm = NewObject([_thermometer],lcLibraryLocation+[_therm],[],[Progress Example])
 loTherm.Show
 =INKEY(lnPause,[HM])
 loTherm.Update(10) && just set the progress bar
 =INKEY(lnPause,[HM])
 loTherm.Update(20,[80 percent to go]) && set progress bar and show a subtitle
 =INKEY(lnPause,[HM])
 loTherm.Update(50,[half way])
 =INKEY(lnPause,[HM])
 loTherm.Complete([Ready])
 =INKEY(lnPause,[HM])
 loTherm.Release

Leave a Reply

Your email address will not be published. Required fields are marked *