View Single Post
 
Old 07-19-2016, 04:44 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,166
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

And what do you want to do if the same page number appears twice?

I don't have the excitement levels to code this at present but would approach this in the following way:
Replace all spaces with nothing
Split into an array
Loop the array to convert the dashes into a series of numbers separated by commas
Convert the array back into a string separated by commas
Split into an array a second time and do a bubblesort to arrange them in ascending order
Convert the final array back into a string separated by commas

You could remove a couple of steps if you converted the initial string into an ado.recordset which simplifies the sorting requirement.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote