ImageEn, unit iexUtils

IEIntArrayToStr


Declaration

function IEIntArrayToStr(Arr: TIEArrayOfInteger; Sort: Boolean = False): string;


Description

Converts a zero-based array of integers, e.g. [0,3,5,6,7], to a compact string of comma-separated values, e.g. "1, 3, 5-7".
The result can be converted back to array using IEStrToIntArray.

If Sort is enabled the result will be sorted and duplicates will be removed.

Note: Input values are expected to be zero-based. Result values will be one-based, i.e. 0 will be returned as "1", etc.


Examples

// The following have the same effect...
ImageEnMView1.MultiSelectedImagesList := [ 2, 4, 6, 7, 8 ];
ImageEnMView1.MultiSelectedImagesList := IEStrToIntArray( '3, 5, 7-9' );

// Get selection as a string
edtSelectedImages.Text := IEIntArrayToStr( ImageEnMView1.MultiSelectedImagesList ); // e.g. [ 2, 4, 6, 7, 8 ] would return '3, 5, 7-9'


See Also

IEStrToIntArray
LayersSelectedList
MultiSelectedImagesList