Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Append from or Copy To with progressbar
Message
De
19/02/2001 00:06:45
 
 
À
18/02/2001 23:08:50
Adam Skowronski
Custom Designed Systems
Miami, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00476841
Message ID:
00477190
Vues:
29
>Here is a possible solution to the count needed for the number of records. I once had to do the same, importing from csv files, and knowing that the size of each record would occupy the same space (or approximately thereof), you could take the total file size and divide it by the approx record size to get the number of records. This figure could then be used for the progressbar without having to do any kind of low level read or double run. Not rocket science, but could work well enough.

It would be easier than actually countng lines, but it's bound to be off in large files, and the user ends up seeing the wrong number of records imported, leading to the inevitable bug report.

In VFP6, finding the line count is as easy as:

nLines = OCCURS(CHR(13), FILETOSTR(cMyFileName))
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform