Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Progress bar while indexing
Message
De
09/12/2004 11:53:32
 
 
À
09/12/2004 11:23:18
Randy Riegel
Zimish Contracting
Ohio, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
SAMBA Server
Database:
Visual FoxPro
Divers
Thread ID:
00968025
Message ID:
00968047
Vues:
11
Randy

I use a thermometer to show progress while going through several passes of a low-level text file, to import all the data to my database. But for that I need to know max records. So 1st I gotta count them, but i can't use a thermo for that.

What I do is:
lcWaitMess    = "Counting Routes input data records..."
Wait Window lcWaitMess At 10, 120 Nowait NOCLEAR
llEOF	    = .F.

With thisform 
  .nMaxJ	= 0														&& Count of no. of J-like recs
  ...					&& Posit so can stay in loop 1st time
  Do While Not llEOF															&& of Bus source records
    If MOD(.nMaxJ, 16000) = 0
    	lcWaitMess    = lcWaitMess + "."
	Wait Window lcWaitMess At 10, 120 Nowait NOCLEAR
    Endif 
    ...		
 *  test for set llEOF   
    If Not INLIST( lcRecID, "QS", "QE", "QN", "QO", "QT", "QI", "QR")	&& If not a journey-type rec
        llEOF	= .T.
    Else
        .nMaxJ	= .nMaxJ + 1
    Endif 
    ...  
  Enddo 
EndWith
Wait clear
So we get a wait window with a progressive list of dots. To save on processor time, the wait is only updated every 16000 lines in the text file.

.nMaxJ is used for the thermo

This work for you?

Terry

>Thanks alot, I'll probably just create "please wait" form. It already takes about 30 seconds to index the file, I don't want to slow it down any more. Right now it says it's indexing and counts the records in the status bar but I want something more user friendly to tell the end user to hold on.
>
>Randy
>
>
>
>
>>NOt really. You'd have to two one of two things...
>>
>>1) Use a condition on the index tag, something like FOR ProgressBar(). However, this condition will remain with the index, slowing down subsequent table updates and inserts. The UDF will always need to be available anytime you access the data. It would also slow down the index progress itself.
>>
>>2) Hook into the internals in VFP and intercept the the Indexing mechanism. I don't know of any way to do this...and it may violate your EULA.
>>
>>IMO, a much better idea is to display a form that says something like, "Currently creating index number 1 of 5. Please be patient". Increment each time you get to a new tag.
>>
>>You could also look at SET ODOMETER and SET STATUSBAR ON.
>>
>>
>>>Is there any way to show a prograss bar while creating an index file (.idx)? I'm pulling data from a DBF which is created by a third party product and has no index. When my app starts it creates an index using "index on myfield to myfile.idx". While my program is indexing all it shows is the records counting in the status bar. Is there anyway to show a progress bar when indexing?
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform