>It's been a while but I'm back on this. I've found it easy to update the progress bar whenever I'm in a loop as in your example. However, I am using an "APPEND FROM &IMPFILE DELIMITED" statement so I don't have to use low level file commands. I am using this in the application framework and compiled as a Top Level application. I don't want to display a status bar but I would like to extract the progress number(s) during the "Append" operation if possible. Then I can do the math & update a message or progress bar etc. Any other ideas?
>
>Thanks,
>Greg Taylor
Greg,
Why not use the FOR clause to call a function that uses _TALLY to calculate the progress. Here is a simple example. Rather than putting up a WAIT WINDOW, you could use the function to update the Progress Bar control in a form, write records to a log file or whatever.
********************************************************************************
* Program: ShowAppendProgress.prg
* Date Created: 11/06/2002
* Created by: Dana T. Anderson
* Last Modified: 11/06/2002
* Modified by: Dana T. Anderson
* Purpose: A function to report the number of records
* processed during an APPEND FROM process.
*
********************************************************************************
LOCAL lcAlias
SET ODOMETER TO 1
SELECT myTable
lcAlias = ALIAS()
SELECT 0
CREATE CURSOR myCursor ;
(fieldOne C(15), fieldTwo C(45))
APPEND FROM (lcAlias);
FIELDS fieldOne, fieldTwo ;
FOR showProgress()
showProgress() && needed to get last value of _TALLY
SET ODOMETER TO 100 && default value
RETURN
********************************************************************************
FUNCTION showProgress
WAIT WINDOW PADL(ALLTRIM(STR(_TALLY)), 3, '0') NOWAIT
RETURN .T.
*****************************************************************************
Of course, setting the odometer to 1 may incurr a performance hit, but you could set it to anything that would be acceptable, 10, 25, whatever you want or can tolerate.
Hope this helps.
Dana
Where's the damned Any Key?...too late