Sign in to follow this  
Followers 0
dcop

Maybe BitOR?

3 posts in this topic

Dim $strInStrArray[10] = ["Dir(s)","File(s)","<DIR>","Volume in drive","Volume Serial","Total Files Listed","Directory of"]

    If            StringInStr($a, $strInStrArray[0]) <> 0 Then
        $a = ""
    ElseIf  StringInStr($a, $strInStrArray[1]) <> 0 Then
        $a = ""
    ElseIf      StringInStr($a, $strInStrArray[2]) <> 0 Then
        $a = ""
    ElseIf  StringInStr($a, $strInStrArray[3]) <> 0 Then
        $a = ""
    ElseIf  StringInStr($a, $strInStrArray[4]) <> 0 Then
        $a = ""
    ElseIf  StringInStr($a, $strInStrArray[5]) <> 0 Then
        $a = ""
    ElseIf  StringInStr($a, $strInStrArray[6]) <> 0 Then
        $a = ""
    EndIf

I would like to accomplish skinnying down to 1 'If' but am not able to figue out how to 'Or'

If StringInStr($a, $strInStrArray[0 or 1 or 2 or 3....and so on]) <> 0 Then

TIA, Dennis

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

FOR $e IN $strInStrArray
    If $e <> "" Then $a = ""
NEXT

?

Edited by Siao

"be smart, drink your wine"

Share this post


Link to post
Share on other sites

Dang! Nice, thanx! Never even knew that one exists.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0