[Overview][Constants][Types][Classes][Procedures and functions][Variables] | Reference for unit 'Classes' (#fcl)

# TBits.FindNextBit

Searches the next bit with a particular value.

## Declaration

`public function TBits.FindNextBit: LongInt;`

## Description

FindNextBit resumes a previously started search. It searches for the next bit with the value specified in the FindFirstBit. The search is done towards the end of the array and starts at the position last reported by one of the Find calls or at the position set with SetIndex.

If another bit with the same value is found, its position is returned. If no more bits with the same value are present in the array, -1 is returned.

## Errors

None.

## See also

TBits.FindFirstBit |  | Find first bit with a particular value
TBits.FindPrevBit |  | Searches the previous bit with a particular value.
TBits.OpenBit |  | Returns the position of the first bit that is set to False.
TBits.SetIndex |  | Sets the start position for FindNextBit and FindPrevBit