Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Progress Status during Append
Message
From
27/11/2002 09:57:40
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00705246
Message ID:
00727561
Views:
7
This is can be very useful. Thanks for the idea.

Is there any way to do something similar with the PACK command. It does not support the for clause, but there are times when I need to pack large files and it would be nice to let the user know that something is actually happening.



>>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
Mark Johns
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform