Re: Need Help deleting record from text file

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"Norm" <NormF4@xxxxxxxxxxxxxxxxx> wrote in message news:O9Y5x8JAIHA.748@xxxxxxxxxxxxxxxxxxxxxxx

Wow, What a difference, sorting and finding and displaying
the 10, 871 files takes only 3.7 seconds. It sure is a lot faster.
Thanks very much Mike,

You're welcome. That's about 30 times faster than your original code, so I assume you're quite happy with it. I suspect that there is still a fair bit of improvement still to be had though. Perhaps you might like to have a look next at the method you are using to get the list of files from disk. Presumably you're using the FindFirstFile and FindNextFile APIs [which is about the fastest you're going to get if you've coded it properly] but there is likely to be room for improvement in the string handling parts of that code [the parts that manipulate and / or return the file names]. On a second run [after the data is already in the disk buffers] you should be able to load 10870 filenames from the folder into a VB String array in less than a quarter of a second on most modern machines, so if that part of your existing code takes much longer than that amount of time then there is definitelty room for further improvement. Then you need to look at how you are displaying the list. Just inserting the file names from your String array into a VB ListBox for display purposes can take a couple of seconds, and if you need to display such a list so that the user can scroll throught it there are very much faster methods than a standard ListBox. However, whether you want to go to any more trouble over a couple of seconds is up to you of course, but it might be worth looking at. Overall, you should be able to get a list of your 10870 file names from the folder into a VB String array and then sort that array in a total time of about half a second on most modern machines, so that's the kind of speed I would be aiming for if I were you.

Mike



.



Relevant Pages

  • Re: working LDAP query, well almost.. 800A000D
    ... it as an string array with one value, or a Null if there is no value ... MVP Directory Services ... The following script should get 2 properties form the Administrator ... It does display the sAMAccountName but throws an error when it tries to ...
    (microsoft.public.scripting.vbscript)
  • Re: Swing component to display String[]
    ... >Is there any built-in Java GUI components that will display the contents of ... >a String array? ... I'm simply looking to display a vertical list, ...
    (comp.lang.java.programmer)
  • RE: max table columns in Repeater control
    ... Based on my understanding, you want to display a string array every 5 items ... Instead of using Repeater control, I think DataList may be more suitable ...
    (microsoft.public.dotnet.framework.aspnet)
  • Need to write a function that adjusts words in a string array
    ... I read in all the words into a string array, ... and display the smallest word and how long it is. ... with quotes around them, exclamation points, etc. ... these characters anywhere but the beginning or end it is ok. ...
    (comp.lang.cpp)