Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Progress bar while indexing
Message
De
09/12/2004 11:52:23
 
 
À
09/12/2004 10:50:42
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:
00968046
Vues:
9
>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?

Randy,

There is a way but requires a little programming. Indexing a table requires exclusive access. So you could create an empty temp file of the same structure and index tags. Then USE the temp file and APPEND FROM OrginalFile FOR ProgressUDF() where the UDF performs whatever progress bar display you want.

The UDF will be called for every record you are appending and therefore you can create a counter which you increment on each call. The counter vs. the total reccount count would give you a % processed. This in turn can be used to create your progress bar/meter/whatever.

When the APPEND is complete you delete the original file and rename the temp file to the original file name.

This technique does not add anything to the existing index tags and could even be used to physically sort the table into a particular order, perform the pack at the same time by not appending deleted records, and so forth.
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform