A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.
I’m busy writing a very small little tool that will read through a flatfile and compare records to data in the database.
Some files are quite large, so to not loose track of the progress, I want to show a progress bar.
How do I know how many lines are in the file? (To set a max for the progressbar)
I’m using the FileSystemObject to get the file, open it as textstream then do while not AtEndOfStream to work through the file. But I can’t see from the front end how long still to go while I'm running it.
I don’t want to go the route of reading throught the file first and counting the lines. I want a property that shows the nr of lines.
Can anybody help?
Base your progress bar on the number of bytes.
While you can’t know the number of lines ahead of time you can get grab the file size.
So, for each line you read in, you increment the progress bar based on the byte counter. You simply add the lenght of each text line read to your total byes read...
Albert D. Kallal
Edmonton, Alberta Canada
This topic is archived. No further replies will be accepted.Other recent topics
Powered by FogBugz