OK, here is the function, re-written from scratch:
CODE
Func _StringFindChr($String, $Chars, $CaseSense = 0, $Occurance = 1)
Dim $i = 0, $j, $s1, $sl = StringLen($String), $c1, $cl = StringLen($Chars), $Found
If $Occurance > 0 Then ;Start from left
$SearchDir = 1
$i = 1
ElseIf $Occurance < 0 Then ;Start from right
$SearchDir = -1
$i = $sl
Else ;error
SetError(1)
Return 0
EndIf
;loop through the string
While 0 < $i And $i <= $sl and $Occurance <> 0
$s1 = StringMid($String, $i, 1)
$Found = 0
;loop through the characters
$j = 1
While $j <= $cl and not $Found
$c1 = StringMid($Chars, $j, 1)
If $s1 == $c1 or ($s1 = $c1 and $CaseSense = 0) Then
$Found = -1
Else
$j = $j + 1
EndIf
WEnd
If $Found Then
$Occurance = $Occurance - $SearchDir
EndIf
If $Occurance <> 0 Then $i = $i + $SearchDir
WEnd
if $i > $sl Then $i = 0
Return $i
EndFunc
And this is how it works, for example:
_StringFindAnyChr('the quick brown fox jumped over the lazy dog','aeiou',0,3)
this will find the 3rd occurance of any vowel (regardless of case) in the given string and return it's location.