Jump to content

problem with "StringInStr" parameters


Recommended Posts

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

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

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)
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...