Gracon
04-02-2007, 02:49 PM
Hello,
I am working on a project where the program scans a Word document for references to Figures or Illustrations and then fills in a Text box with the results of the search.
The problem I run into, is that some of the Fig. numbers are non-numeric (as in 1-1 or 1A), so I have to store the values in a String variable type and am having issues sorting them.
Example: Document references Figs 1 - 10 and 10-1.
Code returns: 1, 10-1, 2, 3, (etc.)
My numeric sort is taken care of with a standard bubble sort (will be changing as it's slow), but I don't know of an easy way to sort the 1A and 1-1 types. I was thinking of splitting the 1-1 types into a multi-dimensional array with half of the number in each side, and then sorting that numericly, but I'm hoping that someone might know of an easier way. : pray2:
Any Ideas?
-Gracon
I am working on a project where the program scans a Word document for references to Figures or Illustrations and then fills in a Text box with the results of the search.
The problem I run into, is that some of the Fig. numbers are non-numeric (as in 1-1 or 1A), so I have to store the values in a String variable type and am having issues sorting them.
Example: Document references Figs 1 - 10 and 10-1.
Code returns: 1, 10-1, 2, 3, (etc.)
My numeric sort is taken care of with a standard bubble sort (will be changing as it's slow), but I don't know of an easy way to sort the 1A and 1-1 types. I was thinking of splitting the 1-1 types into a multi-dimensional array with half of the number in each side, and then sorting that numericly, but I'm hoping that someone might know of an easier way. : pray2:
Any Ideas?
-Gracon