|
User Documentation |
|||||||||
prev file | next file | ||||||||||
SUMMARY: fields | routine DETAILS: routine | ||||||||||
./toolbox compress_ints.pro
compress_ints |
Take an integer array, sort it, and convert it to a comma separated string where consecutive values of integers are 'compressed' into a range, using the syntax 'begining:end'.
The returned string is collection of individual integers and ranges separated by commas.
Two consecutive values are left as individual integers, only sequences longer than 3 integers are compressed to a range (there's no savings in space for 2 consecutive integers.
Optional upper and lower limits to the integer values can be specified. Values less than the lower limit are set to that limit and values greater than the upper limit are set to that limit.
Duplicate values are removed before the array is compressed to the string.
Parameters | |
ints |
Integer array to convert |
Keywords | |
llimit |
Optional lower limit to use. |
ulimit |
Optional upper limit to use. |