Yes, the problem isnt inside the function, the problem is in the parameter's. Sometimes you have to think outside the function
You need to change the _SearchString parameter. at the moment it isnt a string but an index for the array.
take a look.
Func _SearchString($hListView, $sSearchString)
ConsoleWrite($hListView & @CRLF)
If StringReplace($hListView, " ", "") = "" Or StringReplace($sSearchString, " ", "") = "" Then Return SetError(2, 0, 0)
$iStringInStr = StringInStr($hListView, $sSearchString)
If Not $iStringInStr Then Return SetError(1, 0, 0)
Local $aReturn[2] = [$iStringInStr, $iStringInStr + StringLen($sSearchString)]
Return $aReturn
EndFunc
Rookie mistake, it will only make things worse
Hope i helped.