Jump to content
Sign in to follow this  
ShadoWarrior

problem with "StringInStr" parameters

Recommended Posts

ShadoWarrior

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

Share this post


Link to post
Share on other sites
WolfWorld

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

Share this post


Link to post
Share on other sites
ShadoWarrior

$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

Share this post


Link to post
Share on other sites
WolfWorld

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)

Share this post


Link to post
Share on other sites
ShadoWarrior

tnx it was a simple white space problem... >_

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  

×