Produced by IDL 7.1.1
User Documentation

./toolbox
compress_ints.pro

Last modification date:
Wed Sep 28 13:27:10 2016

compress_ints

function compress_ints(ints, [llimit=long], [ulimit=long])

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.

Returns
a string represent all of the unique values in the array passed in, optionally truncated to fall withing llimit to ulimit, inclusive.

Parameters
ints
in, required
long
Integer array to convert

Keywords
llimit
in, optional
long
Optional lower limit to use.
ulimit
in, optional
long
Optional upper limit to use.


Produced by IDLdoc 1.6 on Wed Sep 28 13:27:37 2016