Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting Arrays 1

Status
Not open for further replies.

Swi

Programmer
Feb 4, 2002
1,963
0
36
US
Is there any way to monitor the progress when an array is sorting other than writing my own routine?

aryData.Sort(aryData)

Swi
 
Interesting question.. I don't think there's a way. Never heard of doing that for a high-level language- I can't think of a way to know how "unsorted" it is without iterating over the array every time.

The best I can think of would be to create a custom IComparer and use it for your comparisons, so you could log every time a comparison is made and thereby approximate progress.

If you don't mind me asking, what's it for?
 
A count routine. Counting instances within text files and storing them in arrays, sorting the array and then comparing the records of the sorted array and writing out the results to a report file. Here is what the report looks like. I did it this way in VB6 because it did not have sorted container like other programming languages.

4/12/2005 2:26:05 PM


COUNT % OF FILE
---------------------------------------------------------------------------------------------------------
2031166 100.00% RESIDENT
---------------------------------------------------------------------------------------------------------
1 <-----TOTAL # OF OCCURENCES
2031166 <-----TOTAL # OF RECORDS

VBCounts v1.0
FIELD SUMMARY
INPUT FILE---------------> C:\767203TEST
REPORT FILE--------------> C:\767203TEST.TXT
COUNT FIELD 1------------> 0001 for 50

Swi
 
Thanks, I will check it out.

Swi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top