Jump to content

Please help using "or" in a if statement


 Share

Recommended Posts

Hello I am detecting the fist 3 characters of a string and I want the script to do something if they match.  This works

Local $smidds = StringMid($readsn,1,3)
ToolTip($smidds,0,0)
If $smidds = "CN0" Then
;do whatever
EndIf

However when I try this it detects every 3 character string and tries to "do whatever".  Not just the CN0, PH0, MY0

Local $smidds = StringMid($readsn,1,3)
ToolTip($smidds,0,0)
If $smidds = "CN0" or "MY0" or "PH0" Then
;do whatever
EndIf

Any help?  And thanks for all the help over the years autoit community!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...