Click or drag to resize

AscendingIntegerCollectionGetNextRangeAscending Method

Get the next range (i.e. a contiguous range of integers) in ascending order.

Namespace: Altaxo.Collections
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public bool GetNextRangeAscending(
	ref int currentposition,
	out ContiguousIntegerRange result
)

Parameters

currentposition  Int32
The current position into this collection. Use 0 for the first time. On return, this is the next position.
result  ContiguousIntegerRange
Returns the next contiguous range if the return value is true.

Return Value

Boolean
True if the returned data are valid, false if there is no more data.
Remarks
You can use this function in a while loop:
C#
int rangestart, rangecount;
int currentPosition=0;
while(GetNextRangeAscending(ref currentPosition, out rangestart, out rangecount))
  {
  // do your things here
  }
See Also