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!

progress

Status
Not open for further replies.

newapocalipsis

Programmer
Aug 10, 2001
48
0
0
MX
any one know how to make a progress bar toi advance in reindex depending the numbers of records?
 
While not a "progress bar", if you set TALK ON just before you start the indexing, FoxPro will show the status in the current window. You can control how often it's updated using SET ODOMETER.

There was a routine a while back in one of the FoxPro magazines, that used the technique of adding a UDF to the index expression to show the progress. The "bad" news, was that you then had to use the low-level IO routines to go into the .CDX file and kill off this UDF reference in the index expression so you could actually use the file. (In my opinion, this is at the very least a huge KLUDGE and is just inviting trouble.)

Rick
 
un example for you.

*
* ACTTHERM(<text>) - Activate thermometer.
*
* Activates thermometer. Update the thermometer with UPDTHERM().
* Thermometer window is named &quot;thermometer.&quot; Be sure to RELEASE
* this window when done with thermometer. Creates the global
* m.g_thermwidth.
*
PROCEDURE acttherm
PARAMETER m.text
DEFINE WINDOW thermomete ;
AT INT((SROW() - (( 5.615 * ;
FONTMETRIC(1, c_dlgface, c_dlgsize, c_dlgstyle )) / ;
FONTMETRIC(1, WFONT(1,&quot;&quot;), WFONT( 2,&quot;&quot;), WFONT(3,&quot;&quot;)))) / 2), ;
INT((SCOL() - (( 63.833 * ;
FONTMETRIC(6, c_dlgface, c_dlgsize, c_dlgstyle )) / ;
FONTMETRIC(6, WFONT(1,&quot;&quot;), WFONT( 2,&quot;&quot;), WFONT(3,&quot;&quot;)))) / 2) ;
SIZE 5.615,63.833 ;
FONT c_dlgface, c_dlgsize ;
STYLE c_dlgstyle ;
NOFLOAT ;
NOCLOSE ;
NONE ;
COLOR RGB(0, 0, 0, 192, 192, 192)
MOVE WINDOW thermomete CENTER
ACTIVATE WINDOW thermomete NOSHOW

@ 0.5,3 SAY m.text FONT c_dlgface, c_dlgsize STYLE c_dlgstyle
@ 0.000,0.000 TO 0.000,63.833 ;
COLOR RGB(255, 255, 255, 255, 255, 255)
@ 0.000,0.000 TO 5.615,0.000 ;
COLOR RGB(255, 255, 255, 255, 255, 255)
@ 0.385,0.667 TO 5.231,0.667 ;
COLOR RGB(128, 128, 128, 128, 128, 128)
@ 0.308,0.667 TO 0.308,63.167 ;
COLOR RGB(128, 128, 128, 128, 128, 128)
@ 0.385,63.000 TO 5.308,63.000 ;
COLOR RGB(255, 255, 255, 255, 255, 255)
@ 5.231,0.667 TO 5.231,63.167 ;
COLOR RGB(255, 255, 255, 255, 255, 255)
@ 5.538,0.000 TO 5.538,63.833 ;
COLOR RGB(128, 128, 128, 128, 128, 128)
@ 0.000,63.667 TO 5.615,63.667 ;
COLOR RGB(128, 128, 128, 128, 128, 128)
@ 3.000,3.333 TO 4.231,3.333 ;
COLOR RGB(128, 128, 128, 128, 128, 128)
@ 3.000,60.333 TO 4.308,60.333 ;
COLOR RGB(255, 255, 255, 255, 255, 255)
@ 3.000,3.333 TO 3.000,60.333 ;
COLOR RGB(128, 128, 128, 128, 128, 128)
@ 4.231,3.333 TO 4.231,60.500 ;
COLOR RGB(255, 255, 255, 255, 255, 255)
m.g_thermwidth = 56.269
SHOW WINDOW thermomete TOP
RETURN

*
* UPDTHERM(<percent>) - Update thermometer.
*
PROCEDURE updtherm
PARAMETER m.percent,m.text
PRIVATE m.nblocks, m.percent
IF EMPTY(m.text)
m.text=&quot; &quot;
ENDIF
ACTIVATE WINDOW thermomete

* Map to the number of platforms we are generating for
m.percent = MIN(INT(m.percent) ,100)

m.nblocks = (m.percent/100) * (m.g_thermwidth)
@ 2,5 SAY m.percent PICTURE &quot;999%&quot;
@ 2,20 SAY m.text
@ 3.000,3.333 TO 4.231,m.nblocks + 3.333 ;
PATTERN 1 COLOR RGB(128, 128, 128, 128, 128, 128)
RETURN

*
* DEACTTHERMO - Deactivate and Release thermometer window.
*
PROCEDURE deactthermo
IF WEXIST(&quot;thermomete&quot;)
RELEASE WINDOW thermomete
ENDIF
RETURN



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top