The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

VB6: File system object

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?
Seraph Send private email
Thursday, March 01, 2007
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
Albert D. Kallal Send private email
Thursday, March 01, 2007
Brilliant...  Now why didn't I think of that?

I'll give it a go.
Seraph Send private email
Thursday, March 01, 2007
That's why he's Doctor Killal
Thursday, March 01, 2007

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz