All pastes #580894 Raw Edit

Miles

public cpp v1 · immutable
·published 2007-06-21 08:35 UTC
rendered paste body
Private Function ArraySearch(srcArray As Variant, srcSearchString As String) As Integer    'Returns the index of the matching array slice.    Dim s As String, x As Integer, y As Integer, z As Integer    On Error GoTo Fail    SortArray srcArray    For x = 1 To Len(srcSearchString)        s = Mid(srcSearchString, 1, x)        Do Until Mid(srcArray(z), 1, x) = s            z = z + 1: Loop    Next x    ArraySearch = zFail:End FunctionPrivate Function SortArray(ByRef srcArray As Variant)    Dim Sorted As Boolean, x As Integer, y As String    Sorted = False    Do While Not Sorted        Sorted = True        For x = 0 To UBound(srcArray) - 1            If srcArray(x) > srcArray(x + 1) Then                y = srcArray(x + 1)                srcArray(x + 1) = srcArray(x)                srcArray(x) = y                Sorted = False            End If        Next x    LoopEnd Function