Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Progress Bar.
Message
From
29/09/2001 06:41:17
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
28/09/2001 17:38:15
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00562121
Message ID:
00562219
Views:
19
>The most important thing is when the progress value be equal to 100, star it again with value equal to 0.

Andrews,
By default progressbar max value is 100. This is legal :
with thisform.pBar
 if .Value = 100
    .Value = 0
 else
    .Value = lnNewValue
 endif
endwith

* However next is more generic and safe and doesn't depend on max being 100
with thisform.pBar
 if .Value = .Max
    .Value = .Min
 else
    .Value = min(lnNewValue, .Max)
 endif
endwith
Latter is safer because when providing a new value you might pass a value greater than .Max causing an error.
Remember you don't need to keep default 100 for max and calculate percentage. Just provide .max as real value so it does calculation for you. ie:
select blah blah into cursor crsProcess
with thisform.pBar
  .Max   = _Tally
  .Value = 0
  scan
   * Do something
   .Value = min(.Value+1,.Max) && Safety that might not be needed in fact
  endscan
endwith
Next event would do something similar to start it over.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform