' /** ' * ArrayIndex ' * ' * @param Array ' * @param Zu suchendes Element ' * @return Index des Eintages oder -1 falls das Element nicht im Array ist ' */ Public Function arrayIndex( _ ByRef iElement As Variant, _ ByRef iArray As Variant _ ) As Long If IsEmptyArray(iArray) Then ArrayIndex = -1 Exit Function End If If IsObject(iElement) Then 'Objekte vergleichen: For ArrayIndex = LBound(iArray) To UBound(iArray) If IsObject(iArray(ArrayIndex)) _ Then If iElement Is iArray(ArrayIndex) _ Then Exit Function Next ArrayIndex Else '"Normale" Werte vergleichen: For ArrayIndex = LBound(iArray) To UBound(iArray) If Not IsObject(iArray(ArrayIndex)) _ Then If iElement = iArray(ArrayIndex) _ Then Exit Function Next ArrayIndex End If 'Kein Treffer: ArrayIndex = LBound(iArray) - 1 End Function