magace Posted October 4, 2016 Share Posted October 4, 2016 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 More sharing options...
Anoop Posted October 4, 2016 Share Posted October 4, 2016 Try If $smidds = "CN0" or $smidds = "MY0" or $smidds = "PH0" Then Link to comment Share on other sites More sharing options...
magace Posted October 4, 2016 Author Share Posted October 4, 2016 Thanks! That worked. Link to comment Share on other sites More sharing options...
Anoop Posted October 4, 2016 Share Posted October 4, 2016 3 hours ago, magace said: Thanks! That worked. Please mark the topic for Solved. It should be a good practice. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now