Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FEOF()
Message
De
11/09/2000 14:50:04
Jonathan Cochran
Alion Science and Technology
Maryland, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: FEOF()
Divers
Thread ID:
00415038
Message ID:
00415046
Vues:
16
I update a progress bar, but you could just as easily update the screen caption.

First, find the size of the file:
   **
   ** Find the size of the input file.
   ** Be sure to move back to the beginning of the file.
   **
   ln_TotalBytes = FSEEK( ln_InputFile, 0, 2 )
   = FSEEK( ln_InputFile, 0, 0 )

   **
   ** Initialize a variable to store the percentage currently being
   **  displayed.
   **
   ln_PreviousPercentage = 0
Then, inside your FEOF() loop, use the following to update the caption. I only update the progress bar on percentage increments so it isn't updating too often. If you are doing a lot of processing inside the loop, you may need to update more frequently.
   **
   ** Update the progress (if necessary).
   **
   ln_BytesRead = FSEEK( ln_InputFile, 0, 1 )
   ln_Percentage = ROUND( ( ln_BytesRead / ln_TotalBytes ) * 100, 0 )
   IF ln_Percentage <> ln_PreviousPercentage
      _SCREEN.CAPTION = TRANSFORM( ln_Percentage ) + "%"
      ln_PreviousPercentage = ln_Percentage
   ENDIF
>Is there any way to show progress when scanning a file using low-level functions? I have this code:
>
>Do while not feof(lnHandle)
> .......
>Enddo
>
>It's a very large file so I want to update the _screen.caption or something as it's being scanned. Is there any way to do this?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform