FindDuplicateNumbers

Finds duplicates in an array of numbers.

Syntax

Rhino.FindDuplicateNumbers (arrNumbers [, dblTolerance])

Parameters

arrNumbers

Required.  Array.  An array of numbers.

dblTolerance

Optional.  Number.  The minimum distance between numbers.  Numbers that fall within this tolerance will be discarded.  If omitted, Rhino's internal zero tolerance is used.

Returns

Array

An array of one or more sets, or arrays, of indices that identify the locations of the duplicate numbers if successful.

Null

If not successful or on error.

Example

Dim arrNumbers, arrResults, arrSet, i, nIndex

arrNumbers = Array(1, 2, 3, 4, 2, 4, 5, 6)

arrResults = Rhino.FindDuplicateNumbers(arrNumbers)

If IsArray(arrResults) Then

  Call Rhino.Print("Set Count = " & CStr(UBound(arrResults) + 1))

  For i = 0 to UBound(arrResults)

    arrSet = arrResults(i)

    Call Rhino.Print("Set " & CStr(i+1))

    For Each nIndex in arrSet

      Call Rhino.Print("  Index " & CStr(nIndex) & " = " & CStr(arrNumbers(nIndex)))

    Next

  Next

End If

Also See

FindDuplicatePoints

FindDuplicateStrings