ShadoWarrior Posted August 10, 2009 Share Posted August 10, 2009 I have a problem with understanding what is wrong with "StringInStr"... the first msgbox show a specific window title and the second a substring of it but result always shows "0"???? "... MsgBox(0, "text", $WindowTitle[0]) MsgBox(0, "text", $substring[0][0]) $result = StringInStr($WindowTitle[0], String($substring[0][0])) MsgBox(0, "text", $result) ..." remark: if i change the parameter String($substring[0][0]) to "example" it works perfectly problem is that my input string is always changing Link to comment Share on other sites More sharing options...
WolfWorld Posted August 10, 2009 Share Posted August 10, 2009 I have a problem with understanding what is wrong with "StringInStr"... the first msgbox show a specific window title and the second a substring of it but result always shows "0"???? "... MsgBox(0, "text", $WindowTitle[0]) MsgBox(0, "text", $substring[0][0]) $result = StringInStr($WindowTitle[0], String($substring[0][0])) MsgBox(0, "text", $result) ..." remark: if i change the parameter String($substring[0][0]) to "example" it works perfectly problem is that my input string is always changing $result = StringInStr($WindowTitle[0], String($substring[0][0])) if $result then ;If there is the string in the title else ; No string endif Main project - Eat Spaghetti - Obfuscate and Optimize your script. The most advance add-on.Website more of GadGets! Link to comment Share on other sites More sharing options...
ShadoWarrior Posted August 10, 2009 Author Share Posted August 10, 2009 $result = StringInStr($WindowTitle[0], String($substring[0][0])) if $result then ;If there is the string in the title else ; No string endif lol.. i know how to use "if condition" the problem is that although $substring is real substring of $WindowTitle $result is always 0 Link to comment Share on other sites More sharing options...
WolfWorld Posted August 10, 2009 Share Posted August 10, 2009 Post the part of your code that let to that or I can't do anything much. You can also try this to check for space. MsgBox(0, "text", '*' & $WindowTitle[0] & '*') MsgBox(0, "text", '*' & $substring[0][0] & '*') $result = StringInStr($WindowTitle[0], String($substring[0][0])) MsgBox(0, "text", $result) Main project - Eat Spaghetti - Obfuscate and Optimize your script. The most advance add-on.Website more of GadGets! Link to comment Share on other sites More sharing options...
ShadoWarrior Posted August 10, 2009 Author Share Posted August 10, 2009 tnx it was a simple white space problem... >_ 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